|
let timestampAtual: string = "2022-05-09T17:28:34.132629Z"; // -> Instante em que o Bundle foi criado
|
|
let numeroDoIdentificadorDoSolicitante: number = 0;
|
|
let idRegulaPiaui: number = 0;
|
|
|
|
enum estadoDoDocumento {
|
|
"final",
|
|
"entered-in-error"
|
|
} // -> Valor padrão é "final". "entered-in-error" deve ser usado somente na solicitação de exclusão do regsitro.
|
|
|
|
let codigoCategoria: string = "09"; // -> Valores possíveis em: https://simplifier.net/fhir-test-20231605/modalidade%20assistencial
|
|
let idPaciente: string = "819217217061851";
|
|
let dataAtual: string = "2022-05-09"; // -> Data em que o documento foi gerado
|
|
let CNESEstabelecimento: string = "3191384";
|
|
|
|
enum codigoEvento {
|
|
"pending", // -> Evento destinado a modelar a solicitação de um serviço, bem como o estabelecimento solicitante. É o status inicial da solicitação.
|
|
"returned-to-requester", // -> Evento destinado a modelar a devolução (feita por um estabelecimento regulador) de um serviço ao estabelecimento solicitante.
|
|
"booked", // -> Evento destinado a modelar o agendamento de um serviço, bem como o estabelecimento executante
|
|
"attended" // -> Evento destinado a modelar o atendimento de um serviço, bem como o estabelecimento executante.
|
|
}
|
|
|
|
let dataUltimaAlteracao: string = "2022-05-09T17:31:16.551205Z";
|
|
|
|
enum statusAgendamentoRegulacao {
|
|
"proposed",
|
|
"pending",
|
|
"booked",
|
|
"arrived",
|
|
"fulfilled",
|
|
"cancelled",
|
|
"noshow",
|
|
"entered-in-error",
|
|
"checked-in",
|
|
"waitlist"
|
|
} // -> Valores possiveis: https://simplifier.net/redenacionaldedadosemsaude/valueset-brstatusagendamentoregulacaoassistencial
|
|
|
|
let codigoTipoDeServico: string = "0209010037"; // -> Valores possiveis: https://simplifier.net/redenacionaldedadosemsaude/valueset-brprocedimentosnacionais-1.0
|
|
let codigoEspecialidade: string = "225265"; // -> Valores possiveis: https://simplifier.net/redenacionaldedadosemsaude/codesystem-brcbo
|
|
|
|
enum tipoAgendamento {
|
|
"routine",
|
|
"urgent"
|
|
} // -> valores possiveis: https://simplifier.net/redenacionaldedadosemsaude/valueset-brcarateratendimentomira
|
|
|
|
let dataCriacaoAgendamento: string = "2023-03-09"; // -> Data em que o documento foi gerado
|
|
let tipoParticipante: string = "PCT"; // -> Valores possiveis: https://simplifier.net/redenacionaldedadosemsaude/codesystem-brtipoparticipante
|
|
|
|
enum statusParticipante {
|
|
"accepted",
|
|
"declined",
|
|
"tentative",
|
|
"needs-action"
|
|
} // -> Valores possiveis: https://simplifier.net/redenacionaldedadosemsaude/valueset-brstatusparticipante
|
|
|
|
let statusClinico: string = "active"; // -> Valores possíveis: http://hl7.org/fhir/valueset-condition-clinical.html
|
|
let codigoCategoriaDiagnostico: string = "01"; // -> Valores possiveis: https://simplifier.net/packages/br.ufg.cgis.rnds-lite/0.2.1/files/2463427
|
|
let descricaoCategoriaDiagnostico: string = "Principal"; // -> Valores possiveis: https://simplifier.net/packages/br.ufg.cgis.rnds-lite/0.2.1/files/2463427
|
|
let codigoCID10: string = "I85"; // -> Valores possiveis: https://simplifier.net/packages/br.ufg.cgis.rnds-lite/0.2.4/files/2678688
|
|
let descricaoCID10: string = "Varizes esofagianas sem sangramento"; // -> Valores possiveis: https://simplifier.net/packages/br.ufg.cgis.rnds-lite/0.2.4/files/2678688
|
|
|
|
const bundle = {
|
|
"resourceType": "Bundle",
|
|
"identifier": {
|
|
"system": `http://www.saude.gov.br/fhir/r4/NamingSystem/BRRNDS-${numeroDoIdentificadorDoSolicitante}`,
|
|
"value": `${idRegulaPiaui}`
|
|
},
|
|
"type": "document",
|
|
"timestamp": `${timestampAtual}`,
|
|
"meta": {
|
|
"lastUpdated": `${timestampAtual}`
|
|
},
|
|
"entry": [
|
|
{
|
|
"fullUrl": "urn:uuid:transient-0",
|
|
"resource": {
|
|
"resourceType": "Composition", // -> Indica o tipo do recurso em questão
|
|
"meta": {
|
|
"lastUpdated": `${timestampAtual}`,
|
|
"profile": [
|
|
"http://www.saude.gov.br/fhir/r4/StructureDefinition/BRRegulacaoAssistencial"
|
|
]
|
|
},
|
|
"status": `${estadoDoDocumento.final}`, // -> Identifica um dos valores dos Estados do Documento
|
|
"type": {
|
|
"coding": [
|
|
{
|
|
"system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRTipoDocumento",
|
|
"code": "RA"
|
|
}
|
|
]
|
|
},
|
|
"category": [ // -> Identifica a categoria do documento
|
|
{
|
|
"coding": [
|
|
{
|
|
"system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRModalidadeAssistencial",
|
|
"code": `${codigoCategoria}`
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"subject": { // -> O indivíduo ao qual está associado o resultado do exame
|
|
"identifier": {
|
|
"system": "http://www.saude.gov.br/fhir/r4/StructureDefinition/BRIndividuo-1.0",
|
|
"value": `${idPaciente}`
|
|
}
|
|
},
|
|
"date": `${dataAtual}`, // -> Refere-se à data em que o documento foi gerado
|
|
"author": [
|
|
{
|
|
"identifier": {
|
|
"system": "http://www.saude.gov.br/fhir/r4/StructureDefinition/BREstabelecimentoSaude-1.0",
|
|
"value": `${CNESEstabelecimento}`
|
|
}
|
|
}
|
|
],
|
|
"title": "Regulação Assistencial",
|
|
"event":[
|
|
{
|
|
"code":[{
|
|
"coding": [
|
|
{
|
|
"system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRStatusRegulacaoAssistencial",
|
|
"code": `${codigoEvento.pending}`
|
|
}
|
|
]
|
|
}],
|
|
"period": {
|
|
"start": `${timestampAtual}`, // -> Validar se trata-se do timestamp corrente ou do momento em que o evento de regulacao foi iniciado no sistema de regulacao
|
|
"end": `${timestampAtual}` // -> Validar se trata-se do timestamp corrente ou do momento em que o evento de regulacao foi iniciado no sistema de regulacao
|
|
},
|
|
"detail":[
|
|
{
|
|
|
|
"reference": "urn:uuid:transient-2"
|
|
},
|
|
{
|
|
|
|
"identifier": {
|
|
"system": "http://www.saude.gov.br/fhir/r4/StructureDefinition/BREstabelecimentoSaude-1.0",
|
|
"value": `${CNESEstabelecimento}`
|
|
}
|
|
}
|
|
]
|
|
},
|
|
// {
|
|
// "code":[{
|
|
// "coding": [
|
|
// {
|
|
// "system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRStatusRegulacaoAssistencial",
|
|
// "code": "returned-to-requester"
|
|
// }
|
|
// ]
|
|
// }],
|
|
// "period": {
|
|
// "start": "2023-04-09T00:00:00.000000Z",
|
|
// "end": "2023-04-09T00:00:00.000000Z"
|
|
// },
|
|
// "detail":[
|
|
// {
|
|
|
|
// "identifier": {
|
|
// "system": "http://www.saude.gov.br/fhir/r4/StructureDefinition/BREstabelecimentoSaude-1.0",
|
|
// "value": "0010464"
|
|
// }
|
|
// }
|
|
// ]
|
|
// },
|
|
// {
|
|
// "code":[{
|
|
// "coding": [
|
|
// {
|
|
// "system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRStatusRegulacaoAssistencial",
|
|
// "code": "booked"
|
|
// }
|
|
// ]
|
|
// }],
|
|
// "period": {
|
|
// "start": "2023-04-09T00:00:00.000000Z",
|
|
// "end": "2023-04-09T00:00:00.000000Z"
|
|
// },
|
|
// "detail":[
|
|
// {
|
|
|
|
// "identifier": {
|
|
// "system": "http://www.saude.gov.br/fhir/r4/StructureDefinition/BREstabelecimentoSaude-1.0",
|
|
// "value": "0010464"
|
|
// }
|
|
// },
|
|
// {
|
|
|
|
// "reference": "urn:uuid:transient-1"
|
|
// }
|
|
// ]
|
|
// }
|
|
],
|
|
"section": [
|
|
{
|
|
"entry": [
|
|
{
|
|
"reference": "urn:uuid:transient-1"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"fullUrl": "urn:uuid:transient-1",
|
|
"resource": {
|
|
"resourceType": "Appointment",
|
|
"meta": {
|
|
"lastUpdated": `${dataUltimaAlteracao}`,
|
|
"profile": [
|
|
"http://www.saude.gov.br/fhir/r4/StructureDefinition/BRAgendamentoRegulacaoAssistencial"
|
|
]
|
|
},
|
|
"status": `${statusAgendamentoRegulacao.booked}`,
|
|
"start": `${timestampAtual}`, // -> Validar se trata-se do timestamp corrente ou do momento em que o evento de regulacao foi iniciado no sistema de regulacao
|
|
"end": `${timestampAtual}`, // -> Validar se trata-se do timestamp corrente ou do momento em que o evento de regulacao foi iniciado no sistema de regulacao
|
|
"serviceCategory": [{
|
|
"coding": [{
|
|
"system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRModalidadeAssistencial",
|
|
"code": `${codigoCategoria}`
|
|
}]
|
|
}],
|
|
"serviceType": [{
|
|
"coding": [{
|
|
"system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRTabelaSUS",
|
|
"code": `${codigoTipoDeServico}`
|
|
}]
|
|
}],
|
|
"specialty": [{
|
|
"coding": [{
|
|
"system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRCBO",
|
|
"code": `${codigoEspecialidade}`
|
|
}]
|
|
}],
|
|
"appointmentType": {
|
|
"coding": [
|
|
{
|
|
"system": "http://hl7.org/fhir/request-priority",
|
|
"code": `${tipoAgendamento.urgent}`
|
|
}
|
|
]
|
|
},
|
|
"reasonReference": [
|
|
{
|
|
"reference": "urn:uuid:transient-3"
|
|
}
|
|
],
|
|
"created": `${dataCriacaoAgendamento}`,
|
|
"basedOn": [
|
|
{
|
|
"reference": "urn:uuid:transient-2"
|
|
}
|
|
],
|
|
"participant": [
|
|
{
|
|
"type": [{
|
|
"coding": [
|
|
{
|
|
"system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRTipoParticipante",
|
|
"code": `${tipoParticipante}`
|
|
}
|
|
]
|
|
}],
|
|
"actor":{
|
|
"identifier": {
|
|
"system": "http://www.saude.gov.br/fhir/r4/StructureDefinition/BRIndividuo-1.0",
|
|
"value": `${idPaciente}`
|
|
}
|
|
},
|
|
"status": `${statusParticipante.accepted}`
|
|
}
|
|
]
|
|
}
|
|
},
|
|
// {
|
|
// "fullUrl": "urn:uuid:transient-2",
|
|
// "resource": {
|
|
// "resourceType": "ServiceRequest",
|
|
// "meta": {
|
|
// "lastUpdated": "2022-05-09T17:31:16.551205Z",
|
|
// "profile": [
|
|
// "http://www.saude.gov.br/fhir/r4/StructureDefinition/BRRequisicaoRegulacaoAssistencial"
|
|
// ]
|
|
// },
|
|
// "status": "active",
|
|
// "intent": "proposal",
|
|
// "category": [{
|
|
// "coding": [{
|
|
// "system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRModalidadeAssistencial",
|
|
// "code": "09"
|
|
// }]
|
|
// }],
|
|
// "priority":"urgent",
|
|
// "code": {
|
|
// "coding": [{
|
|
// "system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRTabelaSUS",
|
|
// "code": "0209010037"
|
|
// }]
|
|
// },
|
|
// "subject": {
|
|
// "identifier": {
|
|
// "system": "http://www.saude.gov.br/fhir/r4/StructureDefinition/BRIndividuo-1.0",
|
|
// "value": "{{meu_cns}}"
|
|
// }
|
|
// },
|
|
// "occurrenceDateTime":"2023-05-09",
|
|
// "authoredOn": "2023-03-09",
|
|
// "requester": {
|
|
// "identifier": {
|
|
// "system": "http://www.saude.gov.br/fhir/r4/StructureDefinition/BREstabelecimentoSaude-1.0",
|
|
// "value": "0010464"
|
|
// }
|
|
// },
|
|
// "performerType": {
|
|
// "coding": [{
|
|
// "system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRCBO",
|
|
// "code": "225265"
|
|
// }]
|
|
// },
|
|
// "performer": [{
|
|
// "identifier": {
|
|
// "system": "http://www.saude.gov.br/fhir/r4/StructureDefinition/BREstabelecimentoSaude-1.0",
|
|
// "value": "0010464"
|
|
// }
|
|
// }],
|
|
// "reasonReference": [
|
|
// {
|
|
// "reference": "urn:uuid:transient-3"
|
|
// }
|
|
// ]
|
|
// }
|
|
// },
|
|
{
|
|
"fullUrl": "urn:uuid:transient-3",
|
|
"resource": {
|
|
"resourceType": "Condition",
|
|
"meta": {
|
|
"lastUpdated": "2022-05-09T17:37:55.000322Z",
|
|
"profile": [
|
|
"http://www.saude.gov.br/fhir/r4/StructureDefinition/BRCID10Avaliado-1.0"
|
|
]
|
|
},
|
|
"clinicalStatus": {
|
|
"coding": [
|
|
{
|
|
"system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
|
|
"code": `${statusClinico}`
|
|
}
|
|
]
|
|
},
|
|
"category": [
|
|
{
|
|
"coding": [
|
|
{
|
|
"system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRCategoriaDiagnostico",
|
|
"code": `${codigoCategoriaDiagnostico}`,
|
|
"display": `${descricaoCategoriaDiagnostico}`
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"code": {
|
|
"coding": [
|
|
{
|
|
"system": "http://www.saude.gov.br/fhir/r4/CodeSystem/BRCID10",
|
|
"code": `${codigoCID10}`
|
|
}
|
|
]
|
|
},
|
|
"subject": {
|
|
"identifier": {
|
|
"system": "http://www.saude.gov.br/fhir/r4/StructureDefinition/BRIndividuo-1.0",
|
|
"value": `${idPaciente}`
|
|
}
|
|
},
|
|
"note": [
|
|
{
|
|
"text" : `${descricaoCID10}`
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|