@precisa-saude/fhir 0.31.6 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/biomarkers.cjs +2 -2
- package/dist/biomarkers.js +1 -1
- package/dist/{chunk-WDDW2WCY.js → chunk-4FKZG5GZ.js} +116 -25
- package/dist/chunk-4FKZG5GZ.js.map +1 -0
- package/dist/chunk-5FMR2U7P.cjs +342 -0
- package/dist/chunk-5FMR2U7P.cjs.map +1 -0
- package/dist/{chunk-AZTZYOAV.cjs → chunk-5RC7C7HJ.cjs} +199 -57
- package/dist/chunk-5RC7C7HJ.cjs.map +1 -0
- package/dist/{chunk-N3ZCOLG2.js → chunk-E6MXDQXW.js} +19 -1
- package/dist/chunk-E6MXDQXW.js.map +1 -0
- package/dist/{chunk-OTVCOSCK.cjs → chunk-FGZXQWSR.cjs} +14 -20
- package/dist/chunk-FGZXQWSR.cjs.map +1 -0
- package/dist/chunk-HQ26GOLI.js +342 -0
- package/dist/chunk-HQ26GOLI.js.map +1 -0
- package/dist/{chunk-MNUQ57JR.js → chunk-KS2YZBAS.js} +15 -21
- package/dist/chunk-KS2YZBAS.js.map +1 -0
- package/dist/{chunk-555WKD6J.cjs → chunk-LXKFVJF4.cjs} +3 -3
- package/dist/{chunk-555WKD6J.cjs.map → chunk-LXKFVJF4.cjs.map} +1 -1
- package/dist/{chunk-3ILBFLVQ.cjs → chunk-OAFAERDY.cjs} +20 -2
- package/dist/chunk-OAFAERDY.cjs.map +1 -0
- package/dist/{chunk-3XIMPALK.js → chunk-Q3H5C6UR.js} +198 -56
- package/dist/chunk-Q3H5C6UR.js.map +1 -0
- package/dist/{chunk-MKH4Q735.cjs → chunk-T75NZM56.cjs} +116 -25
- package/dist/chunk-T75NZM56.cjs.map +1 -0
- package/dist/{chunk-PLR54334.js → chunk-WXCX5TJJ.js} +2 -2
- package/dist/{chunk-GBAY6P5P.js → chunk-X5WVIJGG.js} +5 -5
- package/dist/{chunk-PC4NNGBM.cjs → chunk-ZCIZUBMR.cjs} +10 -10
- package/dist/{chunk-PC4NNGBM.cjs.map → chunk-ZCIZUBMR.cjs.map} +1 -1
- package/dist/cli.js +738 -110
- package/dist/converter.cjs +4 -4
- package/dist/converter.js +3 -3
- package/dist/importer.cjs +5 -4
- package/dist/importer.cjs.map +1 -1
- package/dist/importer.js +4 -3
- package/dist/index.cjs +20 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +36 -26
- package/dist/index.js.map +1 -1
- package/dist/reference-ranges.cjs +4 -3
- package/dist/reference-ranges.cjs.map +1 -1
- package/dist/reference-ranges.js +3 -2
- package/dist/sources.cjs +9 -0
- package/dist/sources.cjs.map +1 -0
- package/dist/sources.d.cts +41 -0
- package/dist/sources.d.ts +41 -0
- package/dist/sources.js +9 -0
- package/dist/sources.js.map +1 -0
- package/dist/units.cjs +7 -2
- package/dist/units.cjs.map +1 -1
- package/dist/units.d.cts +53 -5
- package/dist/units.d.ts +53 -5
- package/dist/units.js +6 -1
- package/dist/validators.cjs +4 -2
- package/dist/validators.cjs.map +1 -1
- package/dist/validators.js +3 -1
- package/package.json +11 -1
- package/dist/chunk-3ILBFLVQ.cjs.map +0 -1
- package/dist/chunk-3XIMPALK.js.map +0 -1
- package/dist/chunk-AZTZYOAV.cjs.map +0 -1
- package/dist/chunk-MKH4Q735.cjs.map +0 -1
- package/dist/chunk-MNUQ57JR.js.map +0 -1
- package/dist/chunk-N3ZCOLG2.js.map +0 -1
- package/dist/chunk-OTVCOSCK.cjs.map +0 -1
- package/dist/chunk-WDDW2WCY.js.map +0 -1
- /package/dist/{chunk-PLR54334.js.map → chunk-WXCX5TJJ.js.map} +0 -0
- /package/dist/{chunk-GBAY6P5P.js.map → chunk-X5WVIJGG.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/fhir-brasil/fhir-brasil/packages/core/dist/chunk-FGZXQWSR.cjs","../src/bundle-urls.ts","../src/converter.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACsBO,IAAM,gBAAA,EAAkB,mCAAA;AAgBxB,IAAM,aAAA,EAAe,CAAC,QAAA,EAAA,GAC3B,CAAA,EAAA;ADpCgC;AACA;AEWc;AAChC,EAAA;AACP,IAAA;AACI,MAAA;AAAA;AACJ,IAAA;AACI,MAAA;AAAA;AACT,IAAA;AACS,MAAA;AACX,EAAA;AACF;AAK+B;AACf,EAAA;AACP,IAAA;AACI,MAAA;AACJ,IAAA;AACI,MAAA;AACT,IAAA;AACS,MAAA;AACX,EAAA;AACF;AAamB;AACT,EAAA;AACA,IAAA;AACG,IAAA;AACD,IAAA;AACV,EAAA;AAC+B,EAAA;AACjC;AAoBE;AAM+C,EAAA;AACpB,IAAA;AAElB,IAAA;AACL,MAAA;AAC+B,QAAA;AACC,QAAA;AACD,QAAA;AAC/B,MAAA;AACF,IAAA;AACF,EAAA;AAUgB,EAAA;AACK,IAAA;AACrB,EAAA;AAE4B,EAAA;AAC9B;AAME;AAI8B,EAAA;AAGhB,EAAA;AAMe,EAAA;AACsB,EAAA;AAC1B,IAAA;AACE,IAAA;AACzB,IAAA;AACF,EAAA;AACsB,EAAA;AAGwB,EAAA;AAClC,IAAA;AACR,MAAA;AACU,QAAA;AACN,UAAA;AACQ,YAAA;AACG,YAAA;AACD,YAAA;AACV,UAAA;AACF,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMI,MAAA;AAEF,QAAA;AACE,UAAA;AACQ,YAAA;AACe,YAAA;AACb,YAAA;AACV,UAAA;AAED,QAAA;AACL,QAAA;AACoB,UAAA;AACG,UAAA;AACb,UAAA;AACV,QAAA;AACF,MAAA;AACkB,MAAA;AACpB,IAAA;A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AAA;AACE,QAAA;AAC0B,QAAA;AACZ,QAAA;AAChB,MAAA;AACF,IAAA;AACc,IAAA;AAEZ,IAAA;AACyB,MAAA;AACA,MAAA;AAErB,IAAA;AACyB,MAAA;AACA,MAAA;AAEzB,IAAA;AACR,EAAA;AACF;AAOE;AAI8B,EAAA;AAGL,EAAA;AACN,IAAA;AACW,MAAA;AAC1B,MAAA;AACO,MAAA;AACT,IAAA;AAEkB,IAAA;AACnB,EAAA;AAKsB,EAAA;AAGE,EAAA;AAGL,EAAA;AAEb,EAAA;AACE,IAAA;AACmB,MAAA;AACA,MAAA;AACrB,MAAA;AACL,IAAA;AACc,IAAA;AACR,IAAA;AACR,EAAA;AACF;AFnIkC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/fhir-brasil/fhir-brasil/packages/core/dist/chunk-FGZXQWSR.cjs","sourcesContent":[null,"/**\n * Endereço das entradas de um Bundle.\n *\n * O `fullUrl` identifica a entrada, e é contra ele que o validador resolve as\n * referências entre os recursos. Um Bundle com `subject.reference` valendo\n * `Patient/abc` só resolve se alguma entrada tiver `fullUrl` terminando em\n * `/Patient/abc`: a referência relativa é lida contra a base do `fullUrl` da\n * entrada, que é como os exemplos da própria HL7 montam Bundle de coleção.\n *\n * Antes o `fullUrl` era `urn:uuid:observation-<laudo>-<código>`, que erra duas\n * vezes. `urn:uuid:` exige a sintaxe de UUID e aquilo não era um UUID, e num\n * Bundle de entradas `urn:uuid:` a referência precisa repetir a URN inteira,\n * então nenhuma das relativas resolvia. Um laudo de 22 marcadores saía com 24\n * erros de URN e 22 referências perdidas.\n */\n/**\n * Recurso que já tem id, e por isso pode ser endereçado numa entrada.\n *\n * No FHIR o `id` é opcional, porque um recurso pode viajar sem identidade\n * própria. Numa entrada de Bundle ele não pode: sem id não há `fullUrl`, e sem\n * `fullUrl` nenhuma referência chega ao recurso. Os conversores daqui sempre\n * atribuem um, e o tipo passa a dizer isso em vez de deixar `undefined` chegar\n * até a montagem da URL.\n */\nexport type Addressable<T> = T & { id: string };\n\n/**\n * Base dos `fullUrl`.\n *\n * Não precisa responder a uma requisição: no FHIR o `fullUrl` é identidade, não\n * endereço de download. Fica sob um domínio nosso para não colidir com a\n * identidade de recurso de outra instituição, que é o risco real de usar\n * `example.org` em dado que sai da máquina.\n */\nexport const BUNDLE_BASE_URL = 'https://precisa-saude.com.br/fhir';\n\n/**\n * Monta o `fullUrl` a partir do próprio recurso.\n *\n * Recebe o recurso em vez do tipo e do id soltos de propósito. O defeito que\n * isto substitui nasceu de montar os dois lados em separado: o `fullUrl` dizia\n * `observation-demo-Hgb` enquanto o recurso tinha id `demo-Hgb`, e ninguém\n * percebeu porque nada obrigava os dois a concordarem.\n *\n * O parâmetro pede o mínimo que a URL consome, e não a união de recursos que\n * este pacote converte. Um Bundle pode carregar qualquer recurso do R4, e quem\n * acrescenta uma entrada de um tipo que não está nessa união (um `Specimen`,\n * por exemplo) precisa do mesmo endereço, senão monta o dele e as duas formas\n * divergem outra vez.\n */\nexport const entryFullUrl = (resource: Addressable<{ resourceType: string }>): string =>\n `${BUNDLE_BASE_URL}/${resource.resourceType}/${resource.id}`;\n","/**\n * FHIR Converter\n *\n * Converts lab results to FHIR R4 DiagnosticReport and Observation resources.\n * See: https://hl7.org/fhir/diagnosticreport.html\n */\n\nimport { codeToLoinc } from './biomarkers';\nimport { type Addressable, entryFullUrl } from './bundle-urls';\nimport { BIOMARKER_CODE_SYSTEM, LOINC_SYSTEM } from './code-systems';\nimport type {\n FHIRBundle,\n FHIRDiagnosticReport,\n FHIRObservation,\n FHIRPatient,\n FHIRQuantity,\n FHIRReferenceRange,\n} from './fhir-types';\nimport type { Flag, LabObservationData, LabReportData, UserProfileData } from './types';\nimport { getDefaultUnit, resolveUcum } from './units';\n\n// Re-export all types and functions\nexport * from './fhir-types';\n\n/**\n * Convert Flag to FHIR interpretation code\n */\nfunction interpretationCode(flag: Flag): string {\n switch (flag) {\n case 'H':\n return 'H'; // High\n case 'L':\n return 'L'; // Low\n default:\n return 'N'; // Normal\n }\n}\n\n/**\n * Convert Flag to FHIR interpretation display\n */\nfunction interpretationDisplay(flag: Flag): string {\n switch (flag) {\n case 'H':\n return 'High';\n case 'L':\n return 'Low';\n default:\n return 'Normal';\n }\n}\n\n/**\n * O `coding` do sexo, que vai **dentro** do CodeableConcept do `appliesTo`.\n *\n * O nome diz `CODING` e não `APPLIES_TO` de propósito: isto não é o valor do\n * campo, é uma entrada da lista de codificações dele. O embrulho acontece no\n * uso, em `{ coding: [SEX_CODING[sex]] }`.\n *\n * É o `AdministrativeGender`, e não o v3-ObservationInterpretation nem um\n * sistema nosso: um consumidor que já lê `Patient.gender` compara os dois sem\n * tabela de tradução no meio.\n */\nconst SEX_CODING = {\n female: {\n code: 'female',\n display: 'Female',\n system: 'http://hl7.org/fhir/administrative-gender',\n },\n male: { code: 'male', display: 'Male', system: 'http://hl7.org/fhir/administrative-gender' },\n} as const;\n\n/**\n * Monta as faixas de referência do `Observation`.\n *\n * Duas mudanças em relação ao que existia, e as duas são sobre não perder o que\n * o laudo imprimiu.\n *\n * **Um limite só já basta.** Antes a faixa só saía com os dois, e um laudo que\n * publica \"inferior a 190 mg/dL\" ou \"superior a 60 mL/min/1,73m²\" perdia o\n * campo inteiro. O R4 trata `low` e `high` como opcionais independentes e\n * documenta o caso de um lado só, e o importador deste mesmo pacote já lia\n * `low?.value` e `high?.value` com acesso opcional: a assimetria era só do\n * escritor. Ver PRE-430.\n *\n * **Mais de uma faixa, anotada.** Laudo com uma coluna de referência por sexo\n * passa a sair com as duas, cada uma com o seu `appliesTo`, em vez de o\n * pipeline escolher uma sem saber de quem é o exame. Ver PRE-424 e PRE-425.\n */\nconst buildReferenceRanges = (\n observation: LabObservationData,\n quantity: (value: number) => FHIRQuantity,\n): FHIRReferenceRange[] => {\n // Devolve lista, e não uma faixa: o caso sem limite nenhum vira lista vazia\n // em vez de `undefined`, e aí os dois caminhos abaixo se compõem com\n // `flatMap` sem ninguém precisar filtrar nada depois.\n const toRanges = (low?: number, high?: number, sex?: 'female' | 'male'): FHIRReferenceRange[] => {\n if (low === undefined && high === undefined) return [];\n\n return [\n {\n ...(sex === undefined ? {} : { appliesTo: [{ coding: [SEX_CODING[sex]] }] }),\n ...(high === undefined ? {} : { high: quantity(high) }),\n ...(low === undefined ? {} : { low: quantity(low) }),\n },\n ];\n };\n\n // A lista anotada tem precedência: quando ela existe, o par simples é o\n // resumo de uma das colunas e repeti-lo publicaria a mesma faixa duas vezes,\n // uma delas sem dizer a quem se aplica.\n //\n // Lista vazia cai no par simples, igual a ausente, e isso é escolha: as duas\n // dizem \"não tenho faixa anotada\", e tratá-las diferente faria um `[]` vindo\n // de um `.filter()` apagar em silêncio a faixa que o chamador também mandou\n // em `referenceMin` e `referenceMax`.\n if (observation.referenceRanges && observation.referenceRanges.length > 0) {\n return observation.referenceRanges.flatMap((r) => toRanges(r.low, r.high, r.appliesTo));\n }\n\n return toRanges(observation.referenceMin, observation.referenceMax);\n};\n\n/**\n * Convert generic lab observation to FHIR Observation\n */\nexport function labObservationToFHIR(\n observation: LabObservationData,\n patientId: string,\n laboratoryName?: string,\n): Addressable<FHIRObservation> {\n const loincCode = codeToLoinc(observation.biomarkerCode);\n // Use default unit if source unit is empty\n const sourceUnit =\n observation.unit || getDefaultUnit(observation.biomarkerCode) || observation.unit;\n // `system` + `code` só saem quando a unidade resolve em UCUM. Unidade que o\n // pacote não sabe traduzir fica só em `unit`, como texto: afirmar\n // `http://unitsofmeasure.org` sobre `x10^3/mm3` era publicar um código\n // falso, e quem consome o Bundle confiando no system trataria aquilo como\n // UCUM de verdade.\n const ucumUnit = resolveUcum(sourceUnit, observation.biomarkerCode);\n const quantity = (value: number): FHIRQuantity => ({\n ...(ucumUnit ? { code: ucumUnit, system: 'http://unitsofmeasure.org' } : {}),\n ...(sourceUnit ? { unit: sourceUnit } : {}),\n value,\n });\n const isQualitative = observation.isQualitative || typeof observation.value === 'string';\n\n // Base observation structure\n const fhirObs: Addressable<FHIRObservation> = {\n category: [\n {\n coding: [\n {\n code: 'laboratory',\n display: 'Laboratory',\n system: 'http://terminology.hl7.org/CodeSystem/observation-category',\n },\n ],\n },\n ],\n code: {\n // Sem LOINC, o coding LOINC simplesmente não sai. Antes ia `99999-9`,\n // que não é código LOINC nenhum: publicava sob `http://loinc.org` uma\n // afirmação falsa, e quem consumisse o bundle confiando no system\n // trataria aquilo como código de verdade. Composição corporal, densidade\n // óssea e escore de cálcio não têm LOINC, e o certo é a lacuna explícita.\n coding: [\n ...(loincCode\n ? [\n {\n code: loincCode,\n display: observation.biomarkerName,\n system: LOINC_SYSTEM,\n },\n ]\n : []),\n {\n code: observation.biomarkerCode,\n display: observation.biomarkerName,\n system: BIOMARKER_CODE_SYSTEM,\n },\n ],\n text: observation.biomarkerName,\n },\n effectiveDateTime: observation.collectionDate,\n id: `${observation.reportId}-${observation.biomarkerCode}`,\n interpretation: [\n {\n coding: [\n {\n code: interpretationCode(observation.flag),\n display: interpretationDisplay(observation.flag),\n system: 'http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation',\n },\n ],\n },\n ],\n performer: laboratoryName ? [{ display: laboratoryName }] : undefined,\n resourceType: 'Observation',\n status: 'final',\n subject: {\n reference: `Patient/${patientId}`,\n },\n };\n\n // Add value based on type (qualitative = string, quantitative = number)\n if (isQualitative) {\n fhirObs.valueString = String(observation.value);\n } else {\n fhirObs.valueQuantity = quantity(observation.value as number);\n\n // Reference range only applies to quantitative values\n const referenceRange = buildReferenceRanges(observation, quantity);\n if (referenceRange.length > 0) fhirObs.referenceRange = referenceRange;\n }\n\n return fhirObs;\n}\n\n/**\n * Convert generic lab report to FHIR DiagnosticReport\n */\nexport function labReportToFHIR(\n report: LabReportData,\n patientId: string,\n observationIds: string[],\n): Addressable<FHIRDiagnosticReport> {\n // Map processing status to FHIR status\n let status: FHIRDiagnosticReport['status'];\n switch (report.processingStatus) {\n case 'complete':\n status = 'final';\n break;\n case 'partial':\n status = 'partial';\n break;\n case 'pending_review':\n status = 'preliminary';\n break;\n default:\n status = 'final';\n }\n\n return {\n category: [\n {\n coding: [\n {\n code: 'LAB',\n display: 'Laboratory',\n system: 'http://terminology.hl7.org/CodeSystem/v2-0074',\n },\n ],\n },\n ],\n code: {\n coding: [\n {\n code: '11502-2', // Laboratory report\n display: 'Laboratory report',\n system: 'http://loinc.org',\n },\n ],\n text: 'Laboratory Results',\n },\n conclusion:\n report.overallStatus === 'NORMAL'\n ? 'All results within normal limits'\n : 'One or more abnormal results detected',\n conclusionCode:\n report.overallStatus === 'ANORMAL'\n ? [\n {\n coding: [\n {\n code: 'A',\n display: 'Abnormal',\n system: 'http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation',\n },\n ],\n },\n ]\n : undefined,\n effectiveDateTime: report.collectionDate,\n id: report.reportId,\n issued: report.createdAt,\n performer: report.laboratoryName ? [{ display: report.laboratoryName }] : undefined,\n resourceType: 'DiagnosticReport',\n result: observationIds.map((id) => ({ reference: `Observation/${id}` })),\n status,\n subject: {\n reference: `Patient/${patientId}`,\n },\n };\n}\n\n/**\n * Convert user profile to FHIR Patient\n * NOTE: CPF is intentionally excluded for privacy (LGPD compliance)\n */\nexport function userProfileToFHIR(profile: UserProfileData): Addressable<FHIRPatient> {\n const nameParts = profile.name.split(' ');\n const given = nameParts.slice(0, -1);\n const family = nameParts[nameParts.length - 1] || '';\n\n return {\n address: profile.address\n ? [\n {\n city: profile.address.city,\n country: profile.address.country || 'BR',\n line: [\n profile.address.street && profile.address.number\n ? `${profile.address.street}, ${profile.address.number}`\n : profile.address.street,\n profile.address.complement,\n ].filter(Boolean) as string[],\n postalCode: profile.address.postalCode,\n state: profile.address.state,\n },\n ]\n : undefined,\n birthDate: profile.birthDate,\n gender: profile.gender,\n id: profile.userId,\n name: [\n {\n family,\n given: given.length > 0 ? given : undefined,\n text: profile.name,\n },\n ],\n resourceType: 'Patient',\n telecom:\n [\n ...(profile.email ? [{ system: 'email' as const, value: profile.email }] : []),\n ...(profile.phone ? [{ system: 'phone' as const, value: profile.phone }] : []),\n ].length > 0\n ? [\n ...(profile.email ? [{ system: 'email' as const, value: profile.email }] : []),\n ...(profile.phone ? [{ system: 'phone' as const, value: profile.phone }] : []),\n ]\n : undefined,\n };\n}\n\n/**\n * Convert complete lab result to FHIR Bundle\n * This is the main function for exporting lab results to FHIR R4 format\n */\nexport function labResultToFHIRBundle(\n report: LabReportData,\n observations: LabObservationData[],\n userProfile: UserProfileData,\n): FHIRBundle {\n const patientId = userProfile.userId;\n\n // Convert observations\n const fhirObservations = observations.map((obs) => {\n const resource = labObservationToFHIR(\n { ...obs, collectionDate: report.collectionDate },\n patientId,\n report.laboratoryName,\n );\n\n return { fullUrl: entryFullUrl(resource), resource };\n });\n\n // Os ids vêm dos recursos já montados, e não de uma segunda montagem da mesma\n // regra. O `DiagnosticReport.result` aponta para eles, e era aqui que a\n // referência se separava do recurso.\n const observationIds = fhirObservations.map((entry) => entry.resource.id);\n\n // Convert report\n const diagnosticReport = labReportToFHIR(report, patientId, observationIds);\n\n // Convert patient\n const fhirPatient = userProfileToFHIR(userProfile);\n\n return {\n entry: [\n { fullUrl: entryFullUrl(fhirPatient), resource: fhirPatient },\n { fullUrl: entryFullUrl(diagnosticReport), resource: diagnosticReport },\n ...fhirObservations,\n ],\n resourceType: 'Bundle',\n type: 'collection',\n };\n}\n"]}
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
// src/sources.ts
|
|
2
|
+
var SOURCE_REGISTRY = {
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Fontes internacionais — Cardiovascular
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
"agatston-1990": {
|
|
7
|
+
abnt: "AGATSTON, A. S. et al. Quantification of coronary artery calcium using ultrafast computed tomography. Journal of the American College of Cardiology, v. 15, n. 4, p. 827-832, 1990.",
|
|
8
|
+
doi: "10.1016/0735-1097(90)90282-T",
|
|
9
|
+
key: "agatston-1990",
|
|
10
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/2407762/"
|
|
11
|
+
},
|
|
12
|
+
"browning-ashwell-2010": {
|
|
13
|
+
abnt: "BROWNING, L. M.; HSIEH, S. D.; ASHWELL, M. A systematic review of waist-to-height ratio as a screening tool for the prediction of cardiovascular disease and diabetes: 0,5 could be a suitable global boundary value. Nutrition Research Reviews, v. 23, n. 2, p. 247-269, 2010.",
|
|
14
|
+
doi: "10.1017/S0954422410000144",
|
|
15
|
+
key: "browning-ashwell-2010",
|
|
16
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/20819243/"
|
|
17
|
+
},
|
|
18
|
+
"castelli-ratio-1992": {
|
|
19
|
+
abnt: "CASTELLI, W. P. et al. Lipids and risk of coronary heart disease: the Framingham Study. Annals of Epidemiology, v. 2, n. 1-2, p. 23-28, 1992.",
|
|
20
|
+
doi: "10.1016/1047-2797(92)90033-M",
|
|
21
|
+
key: "castelli-ratio-1992",
|
|
22
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/1342260/"
|
|
23
|
+
},
|
|
24
|
+
"caulfield-ionmobility-2008": {
|
|
25
|
+
abnt: "CAULFIELD, M. P. et al. Direct determination of lipoprotein particle sizes and concentrations by ion mobility analysis. Clinical Chemistry, v. 54, n. 8, p. 1307-1316, 2008.",
|
|
26
|
+
doi: "10.1373/clinchem.2007.100586",
|
|
27
|
+
key: "caulfield-ionmobility-2008",
|
|
28
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/18515257/"
|
|
29
|
+
},
|
|
30
|
+
"contois-apoa1-1996": {
|
|
31
|
+
abnt: "CONTOIS, J. H. et al. Reference intervals for plasma apolipoprotein A-1 determined with a standardized commercial immunoturbidimetric assay: results from the Framingham Offspring Study. Clinical Chemistry, v. 42, n. 4, p. 507-514, 1996.",
|
|
32
|
+
doi: "10.1093/clinchem/42.4.507",
|
|
33
|
+
key: "contois-apoa1-1996",
|
|
34
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/8605666/"
|
|
35
|
+
},
|
|
36
|
+
"ewgsop2-2019": {
|
|
37
|
+
abnt: "CRUZ-JENTOFT, A. J. et al. Sarcopenia: revised European consensus on definition and diagnosis. Age and Ageing, v. 48, n. 1, p. 16-31, 2019.",
|
|
38
|
+
doi: "10.1093/ageing/afy169",
|
|
39
|
+
key: "ewgsop2-2019",
|
|
40
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/30312372/"
|
|
41
|
+
},
|
|
42
|
+
"ferreira-vitd-2017": {
|
|
43
|
+
abnt: "FERREIRA, C. E. S. et al. Posicionamento oficial da Sociedade Brasileira de Patologia Cl\xEDnica/Medicina Laboratorial e da Sociedade Brasileira de Endocrinologia e Metabologia sobre intervalos de refer\xEAncia da vitamina D [25(OH)D]. Archives of Endocrinology and Metabolism, v. 61, n. 6, p. 527-542, 2017.",
|
|
44
|
+
doi: "10.1590/2359-3997000000310",
|
|
45
|
+
key: "ferreira-vitd-2017",
|
|
46
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/29412389/"
|
|
47
|
+
},
|
|
48
|
+
"friedewald-1972": {
|
|
49
|
+
abnt: "FRIEDEWALD, W. T.; LEVY, R. I.; FREDRICKSON, D. S. Estimation of the concentration of low-density lipoprotein cholesterol in plasma, without use of the preparative ultracentrifuge. Clinical Chemistry, v. 18, n. 6, p. 499-502, 1972.",
|
|
50
|
+
doi: "10.1093/clinchem/18.6.499",
|
|
51
|
+
key: "friedewald-1972",
|
|
52
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/4337382/"
|
|
53
|
+
},
|
|
54
|
+
"gallagher-bodyfat-2000": {
|
|
55
|
+
abnt: "GALLAGHER, D. et al. Healthy percentage body fat ranges: an approach for developing guidelines based on body mass index. American Journal of Clinical Nutrition, v. 72, n. 3, p. 694-701, 2000.",
|
|
56
|
+
key: "gallagher-bodyfat-2000",
|
|
57
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/10966886/"
|
|
58
|
+
},
|
|
59
|
+
"ge-corescan": {
|
|
60
|
+
abnt: "GE HEALTHCARE. enCORE Software CoreScan: Visceral Adipose Tissue (VAT) assessment. Madison: GE Medical Systems Lunar, [s. d.]. (Documenta\xE7\xE3o do fabricante do DEXA Lunar Prodigy; classifica\xE7\xE3o Healthy 0\u201352 in\xB3, Increased Risk 52,15\u2013112,10 in\xB3, At Risk 112,10+ in\xB3, equivalente a 0\u2013852 cm\xB3, 854\u20131.837 cm\xB3, 1.837+ cm\xB3.)",
|
|
61
|
+
key: "ge-corescan",
|
|
62
|
+
url: "https://www.gehealthcare.com/products/bone-and-metabolic-health/encore"
|
|
63
|
+
},
|
|
64
|
+
"geloneze-brams-2009": {
|
|
65
|
+
abnt: "GELONEZE, B. et al. HOMA1-IR and HOMA2-IR indexes in identifying insulin resistance and metabolic syndrome \u2014 Brazilian Metabolic Syndrome Study (BRAMS). Arquivos Brasileiros de Endocrinologia & Metabologia, v. 53, n. 2, p. 281-287, 2009.",
|
|
66
|
+
doi: "10.1590/S0004-27302009000200020",
|
|
67
|
+
key: "geloneze-brams-2009",
|
|
68
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/19466221/"
|
|
69
|
+
},
|
|
70
|
+
"george-ck-2016": {
|
|
71
|
+
abnt: "GEORGE, M. D.; MCGILL, N. K.; BAKER, J. F. Creatine kinase in the U.S. population: impact of demographics, comorbidities, and body composition on the normal range. Medicine, v. 95, n. 33, e4344, 2016.",
|
|
72
|
+
doi: "10.1097/MD.0000000000004344",
|
|
73
|
+
key: "george-ck-2016",
|
|
74
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/27537560/"
|
|
75
|
+
},
|
|
76
|
+
"giannitsis-hstnt-2010": {
|
|
77
|
+
abnt: "GIANNITSIS, E. et al. Analytical validation of a high-sensitivity cardiac troponin T assay. Clinical Chemistry, v. 56, n. 2, p. 254-261, 2010.",
|
|
78
|
+
doi: "10.1373/clinchem.2009.132654",
|
|
79
|
+
key: "giannitsis-hstnt-2010",
|
|
80
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/19959623/"
|
|
81
|
+
},
|
|
82
|
+
"glis-2024": {
|
|
83
|
+
abnt: "KIRK, B. et al. The conceptual definition of sarcopenia: Delphi consensus from the Global Leadership Initiative in Sarcopenia (GLIS). Age and Ageing, v. 53, n. 3, afae052, 2024.",
|
|
84
|
+
doi: "10.1093/ageing/afae052",
|
|
85
|
+
key: "glis-2024",
|
|
86
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/38520141/"
|
|
87
|
+
},
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
// Fontes internacionais — Ácidos graxos ômega
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
"harris-omega3-2004": {
|
|
92
|
+
abnt: "HARRIS, W. S.; VON SCHACKY, C. The Omega-3 Index: a new risk factor for death from coronary heart disease? Preventive Medicine, v. 39, n. 1, p. 212-220, 2004.",
|
|
93
|
+
doi: "10.1016/j.ypmed.2004.02.030",
|
|
94
|
+
key: "harris-omega3-2004",
|
|
95
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/15208005/"
|
|
96
|
+
},
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
// Referência laboratorial geral
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
"kalaria-ck-ri-2026": {
|
|
101
|
+
abnt: "KALARIA, T. et al. Age, sex and ethnicity changes in creatine kinase and sex- and ethnicity-specific reference intervals of creatine kinase. Clinical Medicine, v. 26, n. 4, p. 100596, 2026.",
|
|
102
|
+
doi: "10.1016/j.clinme.2026.100596",
|
|
103
|
+
key: "kalaria-ck-ri-2026",
|
|
104
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/42142664/"
|
|
105
|
+
},
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
// Fontes internacionais — Nefrologia
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
"kdigo-ckd-2024": {
|
|
110
|
+
abnt: "KIDNEY DISEASE: IMPROVING GLOBAL OUTCOMES (KDIGO) CKD Work Group. KDIGO 2024 Clinical Practice Guideline for the Evaluation and Management of Chronic Kidney Disease. Kidney International, v. 105, n. 4S, p. S117-S314, 2024.",
|
|
111
|
+
doi: "10.1016/j.kint.2023.10.018",
|
|
112
|
+
key: "kdigo-ckd-2024",
|
|
113
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/38490803/"
|
|
114
|
+
},
|
|
115
|
+
"keller-tni-2013": {
|
|
116
|
+
abnt: "KELLER, T. et al. Defining a reference population to determine the 99th percentile of a contemporary sensitive cardiac troponin I assay. International Journal of Cardiology, v. 167, n. 4, p. 1423-1429, 2013.",
|
|
117
|
+
doi: "10.1016/j.ijcard.2012.04.063",
|
|
118
|
+
key: "keller-tni-2013",
|
|
119
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/22560907/"
|
|
120
|
+
},
|
|
121
|
+
"kelly-dxa-2009": {
|
|
122
|
+
abnt: "KELLY, T. L. et al. Dual energy X-ray absorptiometry body composition reference values from NHANES. PLoS One, v. 4, n. 9, e7038, 2009.",
|
|
123
|
+
doi: "10.1371/journal.pone.0007038",
|
|
124
|
+
key: "kelly-dxa-2009",
|
|
125
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/19753111/"
|
|
126
|
+
},
|
|
127
|
+
"khetarpal-apociii-2016": {
|
|
128
|
+
abnt: "KHETARPAL, S. A. et al. Why is apolipoprotein CIII emerging as a novel therapeutic target to reduce the burden of cardiovascular disease? Current Atherosclerosis Reports, v. 18, n. 10, p. 59, 2016.",
|
|
129
|
+
key: "khetarpal-apociii-2016",
|
|
130
|
+
url: "https://pmc.ncbi.nlm.nih.gov/articles/PMC5018018/"
|
|
131
|
+
},
|
|
132
|
+
"klee-bhb-2020": {
|
|
133
|
+
abnt: "KLEE, P. et al. Test validation, method comparison and reference range for the measurement of \u03B2-hydroxybutyrate in peripheral blood samples. Practical Laboratory Medicine, v. 18, e00146, 2020.",
|
|
134
|
+
doi: "10.1016/j.plabm.2019.e00146",
|
|
135
|
+
key: "klee-bhb-2020",
|
|
136
|
+
url: "https://pmc.ncbi.nlm.nih.gov/articles/PMC6999181/"
|
|
137
|
+
},
|
|
138
|
+
"maisel-bnp-2002": {
|
|
139
|
+
abnt: "MAISEL, A. S. et al. Rapid measurement of B-type natriuretic peptide in the emergency diagnosis of heart failure. New England Journal of Medicine, v. 347, n. 3, p. 161-167, 2002.",
|
|
140
|
+
doi: "10.1056/NEJMoa020233",
|
|
141
|
+
key: "maisel-bnp-2002",
|
|
142
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/12124404/"
|
|
143
|
+
},
|
|
144
|
+
"meuwese-mpo-2007": {
|
|
145
|
+
abnt: "MEUWESE, M. C. et al. Serum myeloperoxidase levels are associated with the future risk of coronary artery disease in apparently healthy individuals: the EPIC-Norfolk Prospective Population Study. Journal of the American College of Cardiology, v. 50, n. 2, p. 159-165, 2007.",
|
|
146
|
+
doi: "10.1016/j.jacc.2007.03.033",
|
|
147
|
+
key: "meuwese-mpo-2007",
|
|
148
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/17616301/"
|
|
149
|
+
},
|
|
150
|
+
// ---------------------------------------------------------------------------
|
|
151
|
+
// Fontes internacionais — Marcadores metabólicos e inflamatórios
|
|
152
|
+
// ---------------------------------------------------------------------------
|
|
153
|
+
"nemeth-adma-2017": {
|
|
154
|
+
abnt: "NEMETH, B. et al. The issue of plasma asymmetric dimethylarginine reference range: a systematic review and meta-analysis. PLoS One, v. 12, n. 5, e0177493, 2017.",
|
|
155
|
+
doi: "10.1371/journal.pone.0177493",
|
|
156
|
+
key: "nemeth-adma-2017",
|
|
157
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/28494019/"
|
|
158
|
+
},
|
|
159
|
+
// ---------------------------------------------------------------------------
|
|
160
|
+
// Fontes brasileiras — Metais pesados (NR-7)
|
|
161
|
+
// ---------------------------------------------------------------------------
|
|
162
|
+
"nr7-pcmso-2020": {
|
|
163
|
+
abnt: "BRASIL. Minist\xE9rio do Trabalho e Emprego. NR-7 \u2014 PCMSO, Quadro 1: Indicadores biol\xF3gicos. Portaria n. 6.734, de 9 de mar\xE7o de 2020. Di\xE1rio Oficial da Uni\xE3o, Bras\xEDlia, 13 mar. 2020.",
|
|
164
|
+
key: "nr7-pcmso-2020",
|
|
165
|
+
url: "https://www.gov.br/trabalho-e-emprego/pt-br/assuntos/inspecao-do-trabalho/seguranca-e-saude-no-trabalho/sst-portarias/2022/portaria-no-567-de-10-de-marco-de-2022-alteracoes-na-nr-7.pdf"
|
|
166
|
+
},
|
|
167
|
+
"ofenheimer-vat-2020": {
|
|
168
|
+
abnt: "OFENHEIMER, A. et al. Reference values of body composition parameters and visceral adipose tissue (VAT) by DXA in adults aged 18-81 years: results from the LEAD cohort. European Journal of Clinical Nutrition, v. 74, p. 1181-1191, 2020.",
|
|
169
|
+
doi: "10.1038/s41430-020-0596-5",
|
|
170
|
+
key: "ofenheimer-vat-2020",
|
|
171
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/32123345/"
|
|
172
|
+
},
|
|
173
|
+
"pns-bioquimica-2019": {
|
|
174
|
+
abnt: "SZWARCWALD, C. L. et al. Valores de refer\xEAncia para exames laboratoriais de colesterol, hemoglobina glicosilada e creatinina da popula\xE7\xE3o adulta brasileira. Revista Brasileira de Epidemiologia, v. 22, supl. 2, e190002.supl.2, 2019.",
|
|
175
|
+
doi: "10.1590/1980-549720190002.supl.2",
|
|
176
|
+
key: "pns-bioquimica-2019",
|
|
177
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/31596373/"
|
|
178
|
+
},
|
|
179
|
+
// ---------------------------------------------------------------------------
|
|
180
|
+
// Pesquisa Nacional de Saúde (PNS) — Intervalos de referência brasileiros
|
|
181
|
+
// ---------------------------------------------------------------------------
|
|
182
|
+
"pns-hemograma-2019": {
|
|
183
|
+
abnt: "ROSENFELD, L. G. et al. Valores de refer\xEAncia para exames laboratoriais de hemograma da popula\xE7\xE3o adulta brasileira: Pesquisa Nacional de Sa\xFAde. Revista Brasileira de Epidemiologia, v. 22, supl. 2, e190003.supl.2, 2019.",
|
|
184
|
+
doi: "10.1590/1980-549720190003.supl.2",
|
|
185
|
+
key: "pns-hemograma-2019",
|
|
186
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/31596374/"
|
|
187
|
+
},
|
|
188
|
+
"pns-renal-2019": {
|
|
189
|
+
abnt: "MALTA, D. C. et al. Evaluation of renal function in the Brazilian adult population, according to laboratory criteria from the National Health Survey. Revista Brasileira de Epidemiologia, v. 22, supl. 2, e190010.supl.2, 2019.",
|
|
190
|
+
doi: "10.1590/1980-549720190010.supl.2",
|
|
191
|
+
key: "pns-renal-2019",
|
|
192
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/31596381/"
|
|
193
|
+
},
|
|
194
|
+
"rumberger-cac-1999": {
|
|
195
|
+
abnt: "RUMBERGER, J. A. et al. Electron beam computed tomographic coronary calcium scanning: a review and guidelines for use in asymptomatic persons. Mayo Clinic Proceedings, v. 74, n. 3, p. 243-252, 1999.",
|
|
196
|
+
doi: "10.4065/74.3.243",
|
|
197
|
+
key: "rumberger-cac-1999",
|
|
198
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/10089993/"
|
|
199
|
+
},
|
|
200
|
+
"sbc-ic-2018": {
|
|
201
|
+
abnt: "ROHDE, L. E. P. et al. Diretriz Brasileira de Insufici\xEAncia Card\xEDaca Cr\xF4nica e Aguda. Arquivos Brasileiros de Cardiologia, S\xE3o Paulo, v. 111, n. 3, p. 436-539, set. 2018.",
|
|
202
|
+
doi: "10.5935/abc.20180190",
|
|
203
|
+
key: "sbc-ic-2018",
|
|
204
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/30379264/"
|
|
205
|
+
},
|
|
206
|
+
// ---------------------------------------------------------------------------
|
|
207
|
+
// Sociedade Brasileira de Cardiologia
|
|
208
|
+
// ---------------------------------------------------------------------------
|
|
209
|
+
"sbc-lipids-2017": {
|
|
210
|
+
abnt: "FALUDI, A. A. et al. Atualiza\xE7\xE3o da Diretriz Brasileira de Dislipidemias e Preven\xE7\xE3o da Aterosclerose \u2013 2017. Arquivos Brasileiros de Cardiologia, S\xE3o Paulo, v. 109, n. 2, supl. 1, p. 1-76, ago. 2017.",
|
|
211
|
+
doi: "10.5935/abc.20170121",
|
|
212
|
+
key: "sbc-lipids-2017",
|
|
213
|
+
url: "https://www.scielo.br/j/abc/a/whBsCyzTDzGYJcsBY7YVkWn/?lang=pt"
|
|
214
|
+
},
|
|
215
|
+
"sbc-lipids-2025": {
|
|
216
|
+
abnt: "RACHED, F. H. et al. Diretriz Brasileira de Dislipidemias e Preven\xE7\xE3o da Aterosclerose \u2013 2025. Arquivos Brasileiros de Cardiologia, S\xE3o Paulo, v. 122, n. 9, e20250640, out. 2025.",
|
|
217
|
+
doi: "10.36660/abc.20250640",
|
|
218
|
+
key: "sbc-lipids-2025",
|
|
219
|
+
url: "https://pmc.ncbi.nlm.nih.gov/articles/PMC12674852/"
|
|
220
|
+
},
|
|
221
|
+
// ---------------------------------------------------------------------------
|
|
222
|
+
// Sociedade Brasileira de Diabetes
|
|
223
|
+
// ---------------------------------------------------------------------------
|
|
224
|
+
"sbd-diabetes-2024": {
|
|
225
|
+
// Chave mantida como 'sbd-diabetes-2024' para compatibilidade com
|
|
226
|
+
// consumidores publicados; a diretriz correspondente é o documento vivo
|
|
227
|
+
// de diretriz.diabetes.org.br, cuja edição citada quando este registro foi
|
|
228
|
+
// atualizado é "Edição 2025". Semelhante ao caso de sbpc-ml-2021 abaixo.
|
|
229
|
+
abnt: "SOCIEDADE BRASILEIRA DE DIABETES (SBD). Diretriz da Sociedade Brasileira de Diabetes \u2014 Edi\xE7\xE3o 2025. S\xE3o Paulo: SBD, 2025.",
|
|
230
|
+
doi: "10.29327/5660187",
|
|
231
|
+
isbn: "978-65-272-1932-3",
|
|
232
|
+
key: "sbd-diabetes-2024",
|
|
233
|
+
url: "https://diretriz.diabetes.org.br"
|
|
234
|
+
},
|
|
235
|
+
// ---------------------------------------------------------------------------
|
|
236
|
+
// Sociedade Brasileira de Endocrinologia e Metabologia
|
|
237
|
+
// ---------------------------------------------------------------------------
|
|
238
|
+
"sbem-thyroid-2013": {
|
|
239
|
+
abnt: "SGARBI, J. A. et al. Consenso brasileiro para a abordagem cl\xEDnica e tratamento do hipotireoidismo subcl\xEDnico em adultos. Arquivos Brasileiros de Endocrinologia & Metabologia, v. 57, n. 3, p. 166-183, 2013.",
|
|
240
|
+
doi: "10.1590/S0004-27302013000300003",
|
|
241
|
+
key: "sbem-thyroid-2013",
|
|
242
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/23681263/"
|
|
243
|
+
},
|
|
244
|
+
"sbem-vitamind-2014": {
|
|
245
|
+
abnt: "MAEDA, S. S. et al. Recomenda\xE7\xF5es da Sociedade Brasileira de Endocrinologia e Metabologia (SBEM) para o diagn\xF3stico e tratamento da hipovitaminose D. Arquivos Brasileiros de Endocrinologia & Metabologia, v. 58, n. 5, p. 411-433, 2014.",
|
|
246
|
+
doi: "10.1590/0004-2730000003388",
|
|
247
|
+
key: "sbem-vitamind-2014",
|
|
248
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/25166032/"
|
|
249
|
+
},
|
|
250
|
+
// ---------------------------------------------------------------------------
|
|
251
|
+
// Sociedade Brasileira de Patologia Clínica / Medicina Laboratorial
|
|
252
|
+
// ---------------------------------------------------------------------------
|
|
253
|
+
"sbpc-ml-2021": {
|
|
254
|
+
// Chave mantida como 'sbpc-ml-2021' para compatibilidade com consumidores;
|
|
255
|
+
// a edição autoritativa é de 2020 (verificada na Biblioteca Digital SBPC/ML
|
|
256
|
+
// em 2026-04-18). Ano na citação ABNT reflete a edição real.
|
|
257
|
+
abnt: "SOCIEDADE BRASILEIRA DE PATOLOGIA CL\xCDNICA/MEDICINA LABORATORIAL (SBPC/ML). Recomenda\xE7\xF5es da Sociedade Brasileira de Patologia Cl\xEDnica/Medicina Laboratorial (SBPC/ML): Boas Pr\xE1ticas em Laborat\xF3rio Cl\xEDnico. S\xE3o Paulo: SBPC/ML, 2020.",
|
|
258
|
+
key: "sbpc-ml-2021",
|
|
259
|
+
url: "https://bibliotecasbpc.org.br/index.php?P=4&C=0.2.443"
|
|
260
|
+
},
|
|
261
|
+
"schumann-ifcc-ldh-2002": {
|
|
262
|
+
abnt: "SCHUMANN, G.; KLAUKE, R. New IFCC reference procedures for the determination of catalytic activity concentrations of five enzymes in serum: preliminary upper reference limits obtained in hospitalized subjects. Clinica Chimica Acta, v. 327, n. 1-2, p. 69-79, 2003.",
|
|
263
|
+
doi: "10.1016/S0009-8981(02)00341-8",
|
|
264
|
+
key: "schumann-ifcc-ldh-2002",
|
|
265
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/12482620/"
|
|
266
|
+
},
|
|
267
|
+
"schwedhelm-sdma-2011": {
|
|
268
|
+
abnt: "SCHWEDHELM, E. et al. Plasma symmetric dimethylarginine reference limits from the Framingham Offspring Cohort. Clinical Chemistry and Laboratory Medicine, v. 49, n. 11, p. 1907-1910, 2011.",
|
|
269
|
+
doi: "10.1515/CCLM.2011.679",
|
|
270
|
+
key: "schwedhelm-sdma-2011",
|
|
271
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/21864208/"
|
|
272
|
+
},
|
|
273
|
+
"selhub-homocysteine-1999": {
|
|
274
|
+
abnt: "SELHUB, J. et al. Serum total homocysteine concentrations in the third National Health and Nutrition Examination Survey (1991-1994): population reference ranges and contribution of vitamin status to high serum concentrations. Annals of Internal Medicine, v. 131, n. 5, p. 331-339, 1999.",
|
|
275
|
+
doi: "10.7326/0003-4819-131-5-199909070-00003",
|
|
276
|
+
key: "selhub-homocysteine-1999",
|
|
277
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/10475885/"
|
|
278
|
+
},
|
|
279
|
+
"simopoulos-omega-ratio-2002": {
|
|
280
|
+
abnt: "SIMOPOULOS, A. P. The importance of the ratio of omega-6/omega-3 essential fatty acids. Biomedicine & Pharmacotherapy, v. 56, n. 8, p. 365-379, 2002.",
|
|
281
|
+
doi: "10.1016/S0753-3322(02)00253-6",
|
|
282
|
+
key: "simopoulos-omega-ratio-2002",
|
|
283
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/12442909/"
|
|
284
|
+
},
|
|
285
|
+
// ---------------------------------------------------------------------------
|
|
286
|
+
// Fontes internacionais — Marcadores tumorais
|
|
287
|
+
// ---------------------------------------------------------------------------
|
|
288
|
+
"sturgeon-nacb-2008": {
|
|
289
|
+
abnt: "STURGEON, C. M. et al. National Academy of Clinical Biochemistry Laboratory Medicine Practice Guidelines for use of tumor markers in testicular, prostate, colorectal, breast, and ovarian cancers. Clinical Chemistry, v. 54, n. 12, p. e11-e79, 2008.",
|
|
290
|
+
doi: "10.1373/clinchem.2008.105601",
|
|
291
|
+
key: "sturgeon-nacb-2008",
|
|
292
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/19042984/"
|
|
293
|
+
},
|
|
294
|
+
"tietz-7ed-2015": {
|
|
295
|
+
abnt: "BURTIS, C. A.; BRUNS, D. E. Tietz Fundamentals of Clinical Chemistry and Molecular Diagnostics. 7. ed. St. Louis: Elsevier Saunders, 2015.",
|
|
296
|
+
isbn: "978-1-4557-4165-6",
|
|
297
|
+
key: "tietz-7ed-2015"
|
|
298
|
+
},
|
|
299
|
+
"torrissen-omega3-dbs-2025": {
|
|
300
|
+
abnt: "TORRISSEN, M. et al. Global variations in omega-3 fatty acid status and omega-6:omega-3 ratios: insights from > 500,000 whole-blood dried blood spot samples. Lipids in Health and Disease, v. 24, n. 1, p. 260, 2025.",
|
|
301
|
+
doi: "10.1186/s12944-025-02676-6",
|
|
302
|
+
key: "torrissen-omega3-dbs-2025",
|
|
303
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/40783537/"
|
|
304
|
+
},
|
|
305
|
+
// ---------------------------------------------------------------------------
|
|
306
|
+
// Fontes internacionais — Coagulação
|
|
307
|
+
// ---------------------------------------------------------------------------
|
|
308
|
+
"wells-ddimer-2003": {
|
|
309
|
+
abnt: "WELLS, P. S. et al. Evaluation of D-dimer in the diagnosis of suspected deep-vein thrombosis. New England Journal of Medicine, v. 349, p. 1227-1235, 2003.",
|
|
310
|
+
doi: "10.1056/NEJMoa023153",
|
|
311
|
+
key: "wells-ddimer-2003",
|
|
312
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/14507948/"
|
|
313
|
+
},
|
|
314
|
+
// ---------------------------------------------------------------------------
|
|
315
|
+
// Fontes internacionais — OMS
|
|
316
|
+
// ---------------------------------------------------------------------------
|
|
317
|
+
"who-iron-2020": {
|
|
318
|
+
abnt: "WORLD HEALTH ORGANIZATION. WHO guideline on use of ferritin concentrations to assess iron status in individuals and populations. Geneva: WHO, 2020.",
|
|
319
|
+
isbn: "978-92-4-000012-4",
|
|
320
|
+
key: "who-iron-2020",
|
|
321
|
+
url: "https://www.who.int/publications/i/item/9789240000124"
|
|
322
|
+
},
|
|
323
|
+
"who-obesity-2000": {
|
|
324
|
+
abnt: "WORLD HEALTH ORGANIZATION. Obesity: preventing and managing the global epidemic. WHO Technical Report Series, n. 894. Geneva: WHO, 2000.",
|
|
325
|
+
isbn: "92-4-120894-5",
|
|
326
|
+
key: "who-obesity-2000"
|
|
327
|
+
},
|
|
328
|
+
"who-osteoporosis-1994": {
|
|
329
|
+
abnt: "WHO STUDY GROUP. Assessment of fracture risk and its application to screening for postmenopausal osteoporosis. WHO Technical Report Series, n. 843. Geneva: WHO, 1994.",
|
|
330
|
+
key: "who-osteoporosis-1994",
|
|
331
|
+
url: "https://pubmed.ncbi.nlm.nih.gov/7941614/"
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
function extractSourceKey(source) {
|
|
335
|
+
return source.split(":")[0] ?? source;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export {
|
|
339
|
+
SOURCE_REGISTRY,
|
|
340
|
+
extractSourceKey
|
|
341
|
+
};
|
|
342
|
+
//# sourceMappingURL=chunk-HQ26GOLI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/sources.ts"],"sourcesContent":["/**\n * Registro de fontes bibliográficas para faixas de referência de biomarcadores.\n *\n * Exportado na API pública desde a 0.32: o campo `source` de cada faixa é uma\n * chave, e sem o registro ao lado ela não resolve para lugar nenhum. Quem\n * consome via `@precisa-saude/fhir/sources` ou pelo `fhir-bio source`.\n *\n * Todas as citações seguem o formato ABNT (NBR 6023).\n */\n\n/**\n * Referência bibliográfica completa para uma fonte de faixas de referência.\n */\nexport interface SourceReference {\n /** Citação completa em formato ABNT (NBR 6023) */\n abnt: string;\n /** DOI, quando disponível */\n doi?: string;\n /** ISBN, quando aplicável */\n isbn?: string;\n /** Chave curta usada no campo `source` de BiomarkerRangeDefinition */\n key: string;\n /** URL de acesso */\n url?: string;\n}\n\n/**\n * Registro central de todas as fontes bibliográficas utilizadas nas faixas de referência.\n *\n * Cada chave corresponde ao valor usado no campo `source` de `BiomarkerRangeDefinition`\n * (sem o sufixo de localização, ex: `'sbc-lipids-2017'` sem `':p15'`).\n */\nexport const SOURCE_REGISTRY: Record<string, SourceReference> = {\n // ---------------------------------------------------------------------------\n // Fontes internacionais — Cardiovascular\n // ---------------------------------------------------------------------------\n 'agatston-1990': {\n abnt: 'AGATSTON, A. S. et al. Quantification of coronary artery calcium using ultrafast computed tomography. Journal of the American College of Cardiology, v. 15, n. 4, p. 827-832, 1990.',\n doi: '10.1016/0735-1097(90)90282-T',\n key: 'agatston-1990',\n url: 'https://pubmed.ncbi.nlm.nih.gov/2407762/',\n },\n\n 'browning-ashwell-2010': {\n abnt: 'BROWNING, L. M.; HSIEH, S. D.; ASHWELL, M. A systematic review of waist-to-height ratio as a screening tool for the prediction of cardiovascular disease and diabetes: 0,5 could be a suitable global boundary value. Nutrition Research Reviews, v. 23, n. 2, p. 247-269, 2010.',\n doi: '10.1017/S0954422410000144',\n key: 'browning-ashwell-2010',\n url: 'https://pubmed.ncbi.nlm.nih.gov/20819243/',\n },\n\n 'castelli-ratio-1992': {\n abnt: 'CASTELLI, W. P. et al. Lipids and risk of coronary heart disease: the Framingham Study. Annals of Epidemiology, v. 2, n. 1-2, p. 23-28, 1992.',\n doi: '10.1016/1047-2797(92)90033-M',\n key: 'castelli-ratio-1992',\n url: 'https://pubmed.ncbi.nlm.nih.gov/1342260/',\n },\n\n 'caulfield-ionmobility-2008': {\n abnt: 'CAULFIELD, M. P. et al. Direct determination of lipoprotein particle sizes and concentrations by ion mobility analysis. Clinical Chemistry, v. 54, n. 8, p. 1307-1316, 2008.',\n doi: '10.1373/clinchem.2007.100586',\n key: 'caulfield-ionmobility-2008',\n url: 'https://pubmed.ncbi.nlm.nih.gov/18515257/',\n },\n\n 'contois-apoa1-1996': {\n abnt: 'CONTOIS, J. H. et al. Reference intervals for plasma apolipoprotein A-1 determined with a standardized commercial immunoturbidimetric assay: results from the Framingham Offspring Study. Clinical Chemistry, v. 42, n. 4, p. 507-514, 1996.',\n doi: '10.1093/clinchem/42.4.507',\n key: 'contois-apoa1-1996',\n url: 'https://pubmed.ncbi.nlm.nih.gov/8605666/',\n },\n\n 'ewgsop2-2019': {\n abnt: 'CRUZ-JENTOFT, A. J. et al. Sarcopenia: revised European consensus on definition and diagnosis. Age and Ageing, v. 48, n. 1, p. 16-31, 2019.',\n doi: '10.1093/ageing/afy169',\n key: 'ewgsop2-2019',\n url: 'https://pubmed.ncbi.nlm.nih.gov/30312372/',\n },\n\n 'ferreira-vitd-2017': {\n abnt: 'FERREIRA, C. E. S. et al. Posicionamento oficial da Sociedade Brasileira de Patologia Clínica/Medicina Laboratorial e da Sociedade Brasileira de Endocrinologia e Metabologia sobre intervalos de referência da vitamina D [25(OH)D]. Archives of Endocrinology and Metabolism, v. 61, n. 6, p. 527-542, 2017.',\n doi: '10.1590/2359-3997000000310',\n key: 'ferreira-vitd-2017',\n url: 'https://pubmed.ncbi.nlm.nih.gov/29412389/',\n },\n\n 'friedewald-1972': {\n abnt: 'FRIEDEWALD, W. T.; LEVY, R. I.; FREDRICKSON, D. S. Estimation of the concentration of low-density lipoprotein cholesterol in plasma, without use of the preparative ultracentrifuge. Clinical Chemistry, v. 18, n. 6, p. 499-502, 1972.',\n doi: '10.1093/clinchem/18.6.499',\n key: 'friedewald-1972',\n url: 'https://pubmed.ncbi.nlm.nih.gov/4337382/',\n },\n\n 'gallagher-bodyfat-2000': {\n abnt: 'GALLAGHER, D. et al. Healthy percentage body fat ranges: an approach for developing guidelines based on body mass index. American Journal of Clinical Nutrition, v. 72, n. 3, p. 694-701, 2000.',\n key: 'gallagher-bodyfat-2000',\n url: 'https://pubmed.ncbi.nlm.nih.gov/10966886/',\n },\n\n 'ge-corescan': {\n abnt: 'GE HEALTHCARE. enCORE Software CoreScan: Visceral Adipose Tissue (VAT) assessment. Madison: GE Medical Systems Lunar, [s. d.]. (Documentação do fabricante do DEXA Lunar Prodigy; classificação Healthy 0–52 in³, Increased Risk 52,15–112,10 in³, At Risk 112,10+ in³, equivalente a 0–852 cm³, 854–1.837 cm³, 1.837+ cm³.)',\n key: 'ge-corescan',\n url: 'https://www.gehealthcare.com/products/bone-and-metabolic-health/encore',\n },\n\n 'geloneze-brams-2009': {\n abnt: 'GELONEZE, B. et al. HOMA1-IR and HOMA2-IR indexes in identifying insulin resistance and metabolic syndrome — Brazilian Metabolic Syndrome Study (BRAMS). Arquivos Brasileiros de Endocrinologia & Metabologia, v. 53, n. 2, p. 281-287, 2009.',\n doi: '10.1590/S0004-27302009000200020',\n key: 'geloneze-brams-2009',\n url: 'https://pubmed.ncbi.nlm.nih.gov/19466221/',\n },\n\n 'george-ck-2016': {\n abnt: 'GEORGE, M. D.; MCGILL, N. K.; BAKER, J. F. Creatine kinase in the U.S. population: impact of demographics, comorbidities, and body composition on the normal range. Medicine, v. 95, n. 33, e4344, 2016.',\n doi: '10.1097/MD.0000000000004344',\n key: 'george-ck-2016',\n url: 'https://pubmed.ncbi.nlm.nih.gov/27537560/',\n },\n\n 'giannitsis-hstnt-2010': {\n abnt: 'GIANNITSIS, E. et al. Analytical validation of a high-sensitivity cardiac troponin T assay. Clinical Chemistry, v. 56, n. 2, p. 254-261, 2010.',\n doi: '10.1373/clinchem.2009.132654',\n key: 'giannitsis-hstnt-2010',\n url: 'https://pubmed.ncbi.nlm.nih.gov/19959623/',\n },\n\n 'glis-2024': {\n abnt: 'KIRK, B. et al. The conceptual definition of sarcopenia: Delphi consensus from the Global Leadership Initiative in Sarcopenia (GLIS). Age and Ageing, v. 53, n. 3, afae052, 2024.',\n doi: '10.1093/ageing/afae052',\n key: 'glis-2024',\n url: 'https://pubmed.ncbi.nlm.nih.gov/38520141/',\n },\n // ---------------------------------------------------------------------------\n // Fontes internacionais — Ácidos graxos ômega\n // ---------------------------------------------------------------------------\n 'harris-omega3-2004': {\n abnt: 'HARRIS, W. S.; VON SCHACKY, C. The Omega-3 Index: a new risk factor for death from coronary heart disease? Preventive Medicine, v. 39, n. 1, p. 212-220, 2004.',\n doi: '10.1016/j.ypmed.2004.02.030',\n key: 'harris-omega3-2004',\n url: 'https://pubmed.ncbi.nlm.nih.gov/15208005/',\n },\n\n // ---------------------------------------------------------------------------\n // Referência laboratorial geral\n // ---------------------------------------------------------------------------\n 'kalaria-ck-ri-2026': {\n abnt: 'KALARIA, T. et al. Age, sex and ethnicity changes in creatine kinase and sex- and ethnicity-specific reference intervals of creatine kinase. Clinical Medicine, v. 26, n. 4, p. 100596, 2026.',\n doi: '10.1016/j.clinme.2026.100596',\n key: 'kalaria-ck-ri-2026',\n url: 'https://pubmed.ncbi.nlm.nih.gov/42142664/',\n },\n\n // ---------------------------------------------------------------------------\n // Fontes internacionais — Nefrologia\n // ---------------------------------------------------------------------------\n 'kdigo-ckd-2024': {\n abnt: 'KIDNEY DISEASE: IMPROVING GLOBAL OUTCOMES (KDIGO) CKD Work Group. KDIGO 2024 Clinical Practice Guideline for the Evaluation and Management of Chronic Kidney Disease. Kidney International, v. 105, n. 4S, p. S117-S314, 2024.',\n doi: '10.1016/j.kint.2023.10.018',\n key: 'kdigo-ckd-2024',\n url: 'https://pubmed.ncbi.nlm.nih.gov/38490803/',\n },\n\n 'keller-tni-2013': {\n abnt: 'KELLER, T. et al. Defining a reference population to determine the 99th percentile of a contemporary sensitive cardiac troponin I assay. International Journal of Cardiology, v. 167, n. 4, p. 1423-1429, 2013.',\n doi: '10.1016/j.ijcard.2012.04.063',\n key: 'keller-tni-2013',\n url: 'https://pubmed.ncbi.nlm.nih.gov/22560907/',\n },\n\n 'kelly-dxa-2009': {\n abnt: 'KELLY, T. L. et al. Dual energy X-ray absorptiometry body composition reference values from NHANES. PLoS One, v. 4, n. 9, e7038, 2009.',\n doi: '10.1371/journal.pone.0007038',\n key: 'kelly-dxa-2009',\n url: 'https://pubmed.ncbi.nlm.nih.gov/19753111/',\n },\n\n 'khetarpal-apociii-2016': {\n abnt: 'KHETARPAL, S. A. et al. Why is apolipoprotein CIII emerging as a novel therapeutic target to reduce the burden of cardiovascular disease? Current Atherosclerosis Reports, v. 18, n. 10, p. 59, 2016.',\n key: 'khetarpal-apociii-2016',\n url: 'https://pmc.ncbi.nlm.nih.gov/articles/PMC5018018/',\n },\n\n 'klee-bhb-2020': {\n abnt: 'KLEE, P. et al. Test validation, method comparison and reference range for the measurement of β-hydroxybutyrate in peripheral blood samples. Practical Laboratory Medicine, v. 18, e00146, 2020.',\n doi: '10.1016/j.plabm.2019.e00146',\n key: 'klee-bhb-2020',\n url: 'https://pmc.ncbi.nlm.nih.gov/articles/PMC6999181/',\n },\n\n 'maisel-bnp-2002': {\n abnt: 'MAISEL, A. S. et al. Rapid measurement of B-type natriuretic peptide in the emergency diagnosis of heart failure. New England Journal of Medicine, v. 347, n. 3, p. 161-167, 2002.',\n doi: '10.1056/NEJMoa020233',\n key: 'maisel-bnp-2002',\n url: 'https://pubmed.ncbi.nlm.nih.gov/12124404/',\n },\n\n 'meuwese-mpo-2007': {\n abnt: 'MEUWESE, M. C. et al. Serum myeloperoxidase levels are associated with the future risk of coronary artery disease in apparently healthy individuals: the EPIC-Norfolk Prospective Population Study. Journal of the American College of Cardiology, v. 50, n. 2, p. 159-165, 2007.',\n doi: '10.1016/j.jacc.2007.03.033',\n key: 'meuwese-mpo-2007',\n url: 'https://pubmed.ncbi.nlm.nih.gov/17616301/',\n },\n\n // ---------------------------------------------------------------------------\n // Fontes internacionais — Marcadores metabólicos e inflamatórios\n // ---------------------------------------------------------------------------\n 'nemeth-adma-2017': {\n abnt: 'NEMETH, B. et al. The issue of plasma asymmetric dimethylarginine reference range: a systematic review and meta-analysis. PLoS One, v. 12, n. 5, e0177493, 2017.',\n doi: '10.1371/journal.pone.0177493',\n key: 'nemeth-adma-2017',\n url: 'https://pubmed.ncbi.nlm.nih.gov/28494019/',\n },\n\n // ---------------------------------------------------------------------------\n // Fontes brasileiras — Metais pesados (NR-7)\n // ---------------------------------------------------------------------------\n 'nr7-pcmso-2020': {\n abnt: 'BRASIL. Ministério do Trabalho e Emprego. NR-7 — PCMSO, Quadro 1: Indicadores biológicos. Portaria n. 6.734, de 9 de março de 2020. Diário Oficial da União, Brasília, 13 mar. 2020.',\n key: 'nr7-pcmso-2020',\n url: 'https://www.gov.br/trabalho-e-emprego/pt-br/assuntos/inspecao-do-trabalho/seguranca-e-saude-no-trabalho/sst-portarias/2022/portaria-no-567-de-10-de-marco-de-2022-alteracoes-na-nr-7.pdf',\n },\n\n 'ofenheimer-vat-2020': {\n abnt: 'OFENHEIMER, A. et al. Reference values of body composition parameters and visceral adipose tissue (VAT) by DXA in adults aged 18-81 years: results from the LEAD cohort. European Journal of Clinical Nutrition, v. 74, p. 1181-1191, 2020.',\n doi: '10.1038/s41430-020-0596-5',\n key: 'ofenheimer-vat-2020',\n url: 'https://pubmed.ncbi.nlm.nih.gov/32123345/',\n },\n\n 'pns-bioquimica-2019': {\n abnt: 'SZWARCWALD, C. L. et al. Valores de referência para exames laboratoriais de colesterol, hemoglobina glicosilada e creatinina da população adulta brasileira. Revista Brasileira de Epidemiologia, v. 22, supl. 2, e190002.supl.2, 2019.',\n doi: '10.1590/1980-549720190002.supl.2',\n key: 'pns-bioquimica-2019',\n url: 'https://pubmed.ncbi.nlm.nih.gov/31596373/',\n },\n\n // ---------------------------------------------------------------------------\n // Pesquisa Nacional de Saúde (PNS) — Intervalos de referência brasileiros\n // ---------------------------------------------------------------------------\n 'pns-hemograma-2019': {\n abnt: 'ROSENFELD, L. G. et al. Valores de referência para exames laboratoriais de hemograma da população adulta brasileira: Pesquisa Nacional de Saúde. Revista Brasileira de Epidemiologia, v. 22, supl. 2, e190003.supl.2, 2019.',\n doi: '10.1590/1980-549720190003.supl.2',\n key: 'pns-hemograma-2019',\n url: 'https://pubmed.ncbi.nlm.nih.gov/31596374/',\n },\n\n 'pns-renal-2019': {\n abnt: 'MALTA, D. C. et al. Evaluation of renal function in the Brazilian adult population, according to laboratory criteria from the National Health Survey. Revista Brasileira de Epidemiologia, v. 22, supl. 2, e190010.supl.2, 2019.',\n doi: '10.1590/1980-549720190010.supl.2',\n key: 'pns-renal-2019',\n url: 'https://pubmed.ncbi.nlm.nih.gov/31596381/',\n },\n\n 'rumberger-cac-1999': {\n abnt: 'RUMBERGER, J. A. et al. Electron beam computed tomographic coronary calcium scanning: a review and guidelines for use in asymptomatic persons. Mayo Clinic Proceedings, v. 74, n. 3, p. 243-252, 1999.',\n doi: '10.4065/74.3.243',\n key: 'rumberger-cac-1999',\n url: 'https://pubmed.ncbi.nlm.nih.gov/10089993/',\n },\n\n 'sbc-ic-2018': {\n abnt: 'ROHDE, L. E. P. et al. Diretriz Brasileira de Insuficiência Cardíaca Crônica e Aguda. Arquivos Brasileiros de Cardiologia, São Paulo, v. 111, n. 3, p. 436-539, set. 2018.',\n doi: '10.5935/abc.20180190',\n key: 'sbc-ic-2018',\n url: 'https://pubmed.ncbi.nlm.nih.gov/30379264/',\n },\n\n // ---------------------------------------------------------------------------\n // Sociedade Brasileira de Cardiologia\n // ---------------------------------------------------------------------------\n 'sbc-lipids-2017': {\n abnt: 'FALUDI, A. A. et al. Atualização da Diretriz Brasileira de Dislipidemias e Prevenção da Aterosclerose – 2017. Arquivos Brasileiros de Cardiologia, São Paulo, v. 109, n. 2, supl. 1, p. 1-76, ago. 2017.',\n doi: '10.5935/abc.20170121',\n key: 'sbc-lipids-2017',\n url: 'https://www.scielo.br/j/abc/a/whBsCyzTDzGYJcsBY7YVkWn/?lang=pt',\n },\n\n 'sbc-lipids-2025': {\n abnt: 'RACHED, F. H. et al. Diretriz Brasileira de Dislipidemias e Prevenção da Aterosclerose – 2025. Arquivos Brasileiros de Cardiologia, São Paulo, v. 122, n. 9, e20250640, out. 2025.',\n doi: '10.36660/abc.20250640',\n key: 'sbc-lipids-2025',\n url: 'https://pmc.ncbi.nlm.nih.gov/articles/PMC12674852/',\n },\n\n // ---------------------------------------------------------------------------\n // Sociedade Brasileira de Diabetes\n // ---------------------------------------------------------------------------\n 'sbd-diabetes-2024': {\n // Chave mantida como 'sbd-diabetes-2024' para compatibilidade com\n // consumidores publicados; a diretriz correspondente é o documento vivo\n // de diretriz.diabetes.org.br, cuja edição citada quando este registro foi\n // atualizado é \"Edição 2025\". Semelhante ao caso de sbpc-ml-2021 abaixo.\n abnt: 'SOCIEDADE BRASILEIRA DE DIABETES (SBD). Diretriz da Sociedade Brasileira de Diabetes — Edição 2025. São Paulo: SBD, 2025.',\n doi: '10.29327/5660187',\n isbn: '978-65-272-1932-3',\n key: 'sbd-diabetes-2024',\n url: 'https://diretriz.diabetes.org.br',\n },\n\n // ---------------------------------------------------------------------------\n // Sociedade Brasileira de Endocrinologia e Metabologia\n // ---------------------------------------------------------------------------\n 'sbem-thyroid-2013': {\n abnt: 'SGARBI, J. A. et al. Consenso brasileiro para a abordagem clínica e tratamento do hipotireoidismo subclínico em adultos. Arquivos Brasileiros de Endocrinologia & Metabologia, v. 57, n. 3, p. 166-183, 2013.',\n doi: '10.1590/S0004-27302013000300003',\n key: 'sbem-thyroid-2013',\n url: 'https://pubmed.ncbi.nlm.nih.gov/23681263/',\n },\n 'sbem-vitamind-2014': {\n abnt: 'MAEDA, S. S. et al. Recomendações da Sociedade Brasileira de Endocrinologia e Metabologia (SBEM) para o diagnóstico e tratamento da hipovitaminose D. Arquivos Brasileiros de Endocrinologia & Metabologia, v. 58, n. 5, p. 411-433, 2014.',\n doi: '10.1590/0004-2730000003388',\n key: 'sbem-vitamind-2014',\n url: 'https://pubmed.ncbi.nlm.nih.gov/25166032/',\n },\n\n // ---------------------------------------------------------------------------\n // Sociedade Brasileira de Patologia Clínica / Medicina Laboratorial\n // ---------------------------------------------------------------------------\n 'sbpc-ml-2021': {\n // Chave mantida como 'sbpc-ml-2021' para compatibilidade com consumidores;\n // a edição autoritativa é de 2020 (verificada na Biblioteca Digital SBPC/ML\n // em 2026-04-18). Ano na citação ABNT reflete a edição real.\n abnt: 'SOCIEDADE BRASILEIRA DE PATOLOGIA CLÍNICA/MEDICINA LABORATORIAL (SBPC/ML). Recomendações da Sociedade Brasileira de Patologia Clínica/Medicina Laboratorial (SBPC/ML): Boas Práticas em Laboratório Clínico. São Paulo: SBPC/ML, 2020.',\n key: 'sbpc-ml-2021',\n url: 'https://bibliotecasbpc.org.br/index.php?P=4&C=0.2.443',\n },\n\n 'schumann-ifcc-ldh-2002': {\n abnt: 'SCHUMANN, G.; KLAUKE, R. New IFCC reference procedures for the determination of catalytic activity concentrations of five enzymes in serum: preliminary upper reference limits obtained in hospitalized subjects. Clinica Chimica Acta, v. 327, n. 1-2, p. 69-79, 2003.',\n doi: '10.1016/S0009-8981(02)00341-8',\n key: 'schumann-ifcc-ldh-2002',\n url: 'https://pubmed.ncbi.nlm.nih.gov/12482620/',\n },\n\n 'schwedhelm-sdma-2011': {\n abnt: 'SCHWEDHELM, E. et al. Plasma symmetric dimethylarginine reference limits from the Framingham Offspring Cohort. Clinical Chemistry and Laboratory Medicine, v. 49, n. 11, p. 1907-1910, 2011.',\n doi: '10.1515/CCLM.2011.679',\n key: 'schwedhelm-sdma-2011',\n url: 'https://pubmed.ncbi.nlm.nih.gov/21864208/',\n },\n\n 'selhub-homocysteine-1999': {\n abnt: 'SELHUB, J. et al. Serum total homocysteine concentrations in the third National Health and Nutrition Examination Survey (1991-1994): population reference ranges and contribution of vitamin status to high serum concentrations. Annals of Internal Medicine, v. 131, n. 5, p. 331-339, 1999.',\n doi: '10.7326/0003-4819-131-5-199909070-00003',\n key: 'selhub-homocysteine-1999',\n url: 'https://pubmed.ncbi.nlm.nih.gov/10475885/',\n },\n\n 'simopoulos-omega-ratio-2002': {\n abnt: 'SIMOPOULOS, A. P. The importance of the ratio of omega-6/omega-3 essential fatty acids. Biomedicine & Pharmacotherapy, v. 56, n. 8, p. 365-379, 2002.',\n doi: '10.1016/S0753-3322(02)00253-6',\n key: 'simopoulos-omega-ratio-2002',\n url: 'https://pubmed.ncbi.nlm.nih.gov/12442909/',\n },\n\n // ---------------------------------------------------------------------------\n // Fontes internacionais — Marcadores tumorais\n // ---------------------------------------------------------------------------\n 'sturgeon-nacb-2008': {\n abnt: 'STURGEON, C. M. et al. National Academy of Clinical Biochemistry Laboratory Medicine Practice Guidelines for use of tumor markers in testicular, prostate, colorectal, breast, and ovarian cancers. Clinical Chemistry, v. 54, n. 12, p. e11-e79, 2008.',\n doi: '10.1373/clinchem.2008.105601',\n key: 'sturgeon-nacb-2008',\n url: 'https://pubmed.ncbi.nlm.nih.gov/19042984/',\n },\n\n 'tietz-7ed-2015': {\n abnt: 'BURTIS, C. A.; BRUNS, D. E. Tietz Fundamentals of Clinical Chemistry and Molecular Diagnostics. 7. ed. St. Louis: Elsevier Saunders, 2015.',\n isbn: '978-1-4557-4165-6',\n key: 'tietz-7ed-2015',\n },\n\n 'torrissen-omega3-dbs-2025': {\n abnt: 'TORRISSEN, M. et al. Global variations in omega-3 fatty acid status and omega-6:omega-3 ratios: insights from > 500,000 whole-blood dried blood spot samples. Lipids in Health and Disease, v. 24, n. 1, p. 260, 2025.',\n doi: '10.1186/s12944-025-02676-6',\n key: 'torrissen-omega3-dbs-2025',\n url: 'https://pubmed.ncbi.nlm.nih.gov/40783537/',\n },\n // ---------------------------------------------------------------------------\n // Fontes internacionais — Coagulação\n // ---------------------------------------------------------------------------\n 'wells-ddimer-2003': {\n abnt: 'WELLS, P. S. et al. Evaluation of D-dimer in the diagnosis of suspected deep-vein thrombosis. New England Journal of Medicine, v. 349, p. 1227-1235, 2003.',\n doi: '10.1056/NEJMoa023153',\n key: 'wells-ddimer-2003',\n url: 'https://pubmed.ncbi.nlm.nih.gov/14507948/',\n },\n\n // ---------------------------------------------------------------------------\n // Fontes internacionais — OMS\n // ---------------------------------------------------------------------------\n 'who-iron-2020': {\n abnt: 'WORLD HEALTH ORGANIZATION. WHO guideline on use of ferritin concentrations to assess iron status in individuals and populations. Geneva: WHO, 2020.',\n isbn: '978-92-4-000012-4',\n key: 'who-iron-2020',\n url: 'https://www.who.int/publications/i/item/9789240000124',\n },\n\n 'who-obesity-2000': {\n abnt: 'WORLD HEALTH ORGANIZATION. Obesity: preventing and managing the global epidemic. WHO Technical Report Series, n. 894. Geneva: WHO, 2000.',\n isbn: '92-4-120894-5',\n key: 'who-obesity-2000',\n },\n\n 'who-osteoporosis-1994': {\n abnt: 'WHO STUDY GROUP. Assessment of fracture risk and its application to screening for postmenopausal osteoporosis. WHO Technical Report Series, n. 843. Geneva: WHO, 1994.',\n key: 'who-osteoporosis-1994',\n url: 'https://pubmed.ncbi.nlm.nih.gov/7941614/',\n },\n};\n\n/**\n * Extrai a chave de fonte de um valor `source` que pode conter localizador.\n *\n * @example\n * extractSourceKey('sbc-lipids-2017:p15') // 'sbc-lipids-2017'\n * extractSourceKey('sbpc-ml-2021') // 'sbpc-ml-2021'\n */\nexport function extractSourceKey(source: string): string {\n return source.split(':')[0] ?? source;\n}\n"],"mappings":";AAgCO,IAAM,kBAAmD;AAAA;AAAA;AAAA;AAAA,EAI9D,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,EACP;AAAA,EAEA,yBAAyB;AAAA,IACvB,MAAM;AAAA,IACN,KAAK;AAAA,IACL,KAAK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,
|
|
3
3
|
LOINC_SYSTEM
|
|
4
4
|
} from "./chunk-A6HR4XDK.js";
|
|
5
|
-
import {
|
|
6
|
-
codeToLoinc
|
|
7
|
-
} from "./chunk-WDDW2WCY.js";
|
|
8
5
|
import {
|
|
9
6
|
getDefaultUnit,
|
|
10
|
-
|
|
11
|
-
} from "./chunk-
|
|
7
|
+
resolveUcum
|
|
8
|
+
} from "./chunk-Q3H5C6UR.js";
|
|
9
|
+
import {
|
|
10
|
+
codeToLoinc
|
|
11
|
+
} from "./chunk-4FKZG5GZ.js";
|
|
12
12
|
|
|
13
13
|
// src/bundle-urls.ts
|
|
14
14
|
var BUNDLE_BASE_URL = "https://precisa-saude.com.br/fhir";
|
|
@@ -45,13 +45,7 @@ var SEX_CODING = {
|
|
|
45
45
|
},
|
|
46
46
|
male: { code: "male", display: "Male", system: "http://hl7.org/fhir/administrative-gender" }
|
|
47
47
|
};
|
|
48
|
-
var buildReferenceRanges = (observation,
|
|
49
|
-
const quantity = (value) => ({
|
|
50
|
-
code: ucumUnit,
|
|
51
|
-
system: "http://unitsofmeasure.org",
|
|
52
|
-
unit: sourceUnit,
|
|
53
|
-
value
|
|
54
|
-
});
|
|
48
|
+
var buildReferenceRanges = (observation, quantity) => {
|
|
55
49
|
const toRanges = (low, high, sex) => {
|
|
56
50
|
if (low === void 0 && high === void 0) return [];
|
|
57
51
|
return [
|
|
@@ -70,7 +64,12 @@ var buildReferenceRanges = (observation, sourceUnit, ucumUnit) => {
|
|
|
70
64
|
function labObservationToFHIR(observation, patientId, laboratoryName) {
|
|
71
65
|
const loincCode = codeToLoinc(observation.biomarkerCode);
|
|
72
66
|
const sourceUnit = observation.unit || getDefaultUnit(observation.biomarkerCode) || observation.unit;
|
|
73
|
-
const ucumUnit =
|
|
67
|
+
const ucumUnit = resolveUcum(sourceUnit, observation.biomarkerCode);
|
|
68
|
+
const quantity = (value) => ({
|
|
69
|
+
...ucumUnit ? { code: ucumUnit, system: "http://unitsofmeasure.org" } : {},
|
|
70
|
+
...sourceUnit ? { unit: sourceUnit } : {},
|
|
71
|
+
value
|
|
72
|
+
});
|
|
74
73
|
const isQualitative = observation.isQualitative || typeof observation.value === "string";
|
|
75
74
|
const fhirObs = {
|
|
76
75
|
category: [
|
|
@@ -129,13 +128,8 @@ function labObservationToFHIR(observation, patientId, laboratoryName) {
|
|
|
129
128
|
if (isQualitative) {
|
|
130
129
|
fhirObs.valueString = String(observation.value);
|
|
131
130
|
} else {
|
|
132
|
-
fhirObs.valueQuantity =
|
|
133
|
-
|
|
134
|
-
system: "http://unitsofmeasure.org",
|
|
135
|
-
unit: sourceUnit,
|
|
136
|
-
value: observation.value
|
|
137
|
-
};
|
|
138
|
-
const referenceRange = buildReferenceRanges(observation, sourceUnit, ucumUnit);
|
|
131
|
+
fhirObs.valueQuantity = quantity(observation.value);
|
|
132
|
+
const referenceRange = buildReferenceRanges(observation, quantity);
|
|
139
133
|
if (referenceRange.length > 0) fhirObs.referenceRange = referenceRange;
|
|
140
134
|
}
|
|
141
135
|
return fhirObs;
|
|
@@ -271,4 +265,4 @@ export {
|
|
|
271
265
|
userProfileToFHIR,
|
|
272
266
|
labResultToFHIRBundle
|
|
273
267
|
};
|
|
274
|
-
//# sourceMappingURL=chunk-
|
|
268
|
+
//# sourceMappingURL=chunk-KS2YZBAS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/bundle-urls.ts","../src/converter.ts"],"sourcesContent":["/**\n * Endereço das entradas de um Bundle.\n *\n * O `fullUrl` identifica a entrada, e é contra ele que o validador resolve as\n * referências entre os recursos. Um Bundle com `subject.reference` valendo\n * `Patient/abc` só resolve se alguma entrada tiver `fullUrl` terminando em\n * `/Patient/abc`: a referência relativa é lida contra a base do `fullUrl` da\n * entrada, que é como os exemplos da própria HL7 montam Bundle de coleção.\n *\n * Antes o `fullUrl` era `urn:uuid:observation-<laudo>-<código>`, que erra duas\n * vezes. `urn:uuid:` exige a sintaxe de UUID e aquilo não era um UUID, e num\n * Bundle de entradas `urn:uuid:` a referência precisa repetir a URN inteira,\n * então nenhuma das relativas resolvia. Um laudo de 22 marcadores saía com 24\n * erros de URN e 22 referências perdidas.\n */\n/**\n * Recurso que já tem id, e por isso pode ser endereçado numa entrada.\n *\n * No FHIR o `id` é opcional, porque um recurso pode viajar sem identidade\n * própria. Numa entrada de Bundle ele não pode: sem id não há `fullUrl`, e sem\n * `fullUrl` nenhuma referência chega ao recurso. Os conversores daqui sempre\n * atribuem um, e o tipo passa a dizer isso em vez de deixar `undefined` chegar\n * até a montagem da URL.\n */\nexport type Addressable<T> = T & { id: string };\n\n/**\n * Base dos `fullUrl`.\n *\n * Não precisa responder a uma requisição: no FHIR o `fullUrl` é identidade, não\n * endereço de download. Fica sob um domínio nosso para não colidir com a\n * identidade de recurso de outra instituição, que é o risco real de usar\n * `example.org` em dado que sai da máquina.\n */\nexport const BUNDLE_BASE_URL = 'https://precisa-saude.com.br/fhir';\n\n/**\n * Monta o `fullUrl` a partir do próprio recurso.\n *\n * Recebe o recurso em vez do tipo e do id soltos de propósito. O defeito que\n * isto substitui nasceu de montar os dois lados em separado: o `fullUrl` dizia\n * `observation-demo-Hgb` enquanto o recurso tinha id `demo-Hgb`, e ninguém\n * percebeu porque nada obrigava os dois a concordarem.\n *\n * O parâmetro pede o mínimo que a URL consome, e não a união de recursos que\n * este pacote converte. Um Bundle pode carregar qualquer recurso do R4, e quem\n * acrescenta uma entrada de um tipo que não está nessa união (um `Specimen`,\n * por exemplo) precisa do mesmo endereço, senão monta o dele e as duas formas\n * divergem outra vez.\n */\nexport const entryFullUrl = (resource: Addressable<{ resourceType: string }>): string =>\n `${BUNDLE_BASE_URL}/${resource.resourceType}/${resource.id}`;\n","/**\n * FHIR Converter\n *\n * Converts lab results to FHIR R4 DiagnosticReport and Observation resources.\n * See: https://hl7.org/fhir/diagnosticreport.html\n */\n\nimport { codeToLoinc } from './biomarkers';\nimport { type Addressable, entryFullUrl } from './bundle-urls';\nimport { BIOMARKER_CODE_SYSTEM, LOINC_SYSTEM } from './code-systems';\nimport type {\n FHIRBundle,\n FHIRDiagnosticReport,\n FHIRObservation,\n FHIRPatient,\n FHIRQuantity,\n FHIRReferenceRange,\n} from './fhir-types';\nimport type { Flag, LabObservationData, LabReportData, UserProfileData } from './types';\nimport { getDefaultUnit, resolveUcum } from './units';\n\n// Re-export all types and functions\nexport * from './fhir-types';\n\n/**\n * Convert Flag to FHIR interpretation code\n */\nfunction interpretationCode(flag: Flag): string {\n switch (flag) {\n case 'H':\n return 'H'; // High\n case 'L':\n return 'L'; // Low\n default:\n return 'N'; // Normal\n }\n}\n\n/**\n * Convert Flag to FHIR interpretation display\n */\nfunction interpretationDisplay(flag: Flag): string {\n switch (flag) {\n case 'H':\n return 'High';\n case 'L':\n return 'Low';\n default:\n return 'Normal';\n }\n}\n\n/**\n * O `coding` do sexo, que vai **dentro** do CodeableConcept do `appliesTo`.\n *\n * O nome diz `CODING` e não `APPLIES_TO` de propósito: isto não é o valor do\n * campo, é uma entrada da lista de codificações dele. O embrulho acontece no\n * uso, em `{ coding: [SEX_CODING[sex]] }`.\n *\n * É o `AdministrativeGender`, e não o v3-ObservationInterpretation nem um\n * sistema nosso: um consumidor que já lê `Patient.gender` compara os dois sem\n * tabela de tradução no meio.\n */\nconst SEX_CODING = {\n female: {\n code: 'female',\n display: 'Female',\n system: 'http://hl7.org/fhir/administrative-gender',\n },\n male: { code: 'male', display: 'Male', system: 'http://hl7.org/fhir/administrative-gender' },\n} as const;\n\n/**\n * Monta as faixas de referência do `Observation`.\n *\n * Duas mudanças em relação ao que existia, e as duas são sobre não perder o que\n * o laudo imprimiu.\n *\n * **Um limite só já basta.** Antes a faixa só saía com os dois, e um laudo que\n * publica \"inferior a 190 mg/dL\" ou \"superior a 60 mL/min/1,73m²\" perdia o\n * campo inteiro. O R4 trata `low` e `high` como opcionais independentes e\n * documenta o caso de um lado só, e o importador deste mesmo pacote já lia\n * `low?.value` e `high?.value` com acesso opcional: a assimetria era só do\n * escritor. Ver PRE-430.\n *\n * **Mais de uma faixa, anotada.** Laudo com uma coluna de referência por sexo\n * passa a sair com as duas, cada uma com o seu `appliesTo`, em vez de o\n * pipeline escolher uma sem saber de quem é o exame. Ver PRE-424 e PRE-425.\n */\nconst buildReferenceRanges = (\n observation: LabObservationData,\n quantity: (value: number) => FHIRQuantity,\n): FHIRReferenceRange[] => {\n // Devolve lista, e não uma faixa: o caso sem limite nenhum vira lista vazia\n // em vez de `undefined`, e aí os dois caminhos abaixo se compõem com\n // `flatMap` sem ninguém precisar filtrar nada depois.\n const toRanges = (low?: number, high?: number, sex?: 'female' | 'male'): FHIRReferenceRange[] => {\n if (low === undefined && high === undefined) return [];\n\n return [\n {\n ...(sex === undefined ? {} : { appliesTo: [{ coding: [SEX_CODING[sex]] }] }),\n ...(high === undefined ? {} : { high: quantity(high) }),\n ...(low === undefined ? {} : { low: quantity(low) }),\n },\n ];\n };\n\n // A lista anotada tem precedência: quando ela existe, o par simples é o\n // resumo de uma das colunas e repeti-lo publicaria a mesma faixa duas vezes,\n // uma delas sem dizer a quem se aplica.\n //\n // Lista vazia cai no par simples, igual a ausente, e isso é escolha: as duas\n // dizem \"não tenho faixa anotada\", e tratá-las diferente faria um `[]` vindo\n // de um `.filter()` apagar em silêncio a faixa que o chamador também mandou\n // em `referenceMin` e `referenceMax`.\n if (observation.referenceRanges && observation.referenceRanges.length > 0) {\n return observation.referenceRanges.flatMap((r) => toRanges(r.low, r.high, r.appliesTo));\n }\n\n return toRanges(observation.referenceMin, observation.referenceMax);\n};\n\n/**\n * Convert generic lab observation to FHIR Observation\n */\nexport function labObservationToFHIR(\n observation: LabObservationData,\n patientId: string,\n laboratoryName?: string,\n): Addressable<FHIRObservation> {\n const loincCode = codeToLoinc(observation.biomarkerCode);\n // Use default unit if source unit is empty\n const sourceUnit =\n observation.unit || getDefaultUnit(observation.biomarkerCode) || observation.unit;\n // `system` + `code` só saem quando a unidade resolve em UCUM. Unidade que o\n // pacote não sabe traduzir fica só em `unit`, como texto: afirmar\n // `http://unitsofmeasure.org` sobre `x10^3/mm3` era publicar um código\n // falso, e quem consome o Bundle confiando no system trataria aquilo como\n // UCUM de verdade.\n const ucumUnit = resolveUcum(sourceUnit, observation.biomarkerCode);\n const quantity = (value: number): FHIRQuantity => ({\n ...(ucumUnit ? { code: ucumUnit, system: 'http://unitsofmeasure.org' } : {}),\n ...(sourceUnit ? { unit: sourceUnit } : {}),\n value,\n });\n const isQualitative = observation.isQualitative || typeof observation.value === 'string';\n\n // Base observation structure\n const fhirObs: Addressable<FHIRObservation> = {\n category: [\n {\n coding: [\n {\n code: 'laboratory',\n display: 'Laboratory',\n system: 'http://terminology.hl7.org/CodeSystem/observation-category',\n },\n ],\n },\n ],\n code: {\n // Sem LOINC, o coding LOINC simplesmente não sai. Antes ia `99999-9`,\n // que não é código LOINC nenhum: publicava sob `http://loinc.org` uma\n // afirmação falsa, e quem consumisse o bundle confiando no system\n // trataria aquilo como código de verdade. Composição corporal, densidade\n // óssea e escore de cálcio não têm LOINC, e o certo é a lacuna explícita.\n coding: [\n ...(loincCode\n ? [\n {\n code: loincCode,\n display: observation.biomarkerName,\n system: LOINC_SYSTEM,\n },\n ]\n : []),\n {\n code: observation.biomarkerCode,\n display: observation.biomarkerName,\n system: BIOMARKER_CODE_SYSTEM,\n },\n ],\n text: observation.biomarkerName,\n },\n effectiveDateTime: observation.collectionDate,\n id: `${observation.reportId}-${observation.biomarkerCode}`,\n interpretation: [\n {\n coding: [\n {\n code: interpretationCode(observation.flag),\n display: interpretationDisplay(observation.flag),\n system: 'http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation',\n },\n ],\n },\n ],\n performer: laboratoryName ? [{ display: laboratoryName }] : undefined,\n resourceType: 'Observation',\n status: 'final',\n subject: {\n reference: `Patient/${patientId}`,\n },\n };\n\n // Add value based on type (qualitative = string, quantitative = number)\n if (isQualitative) {\n fhirObs.valueString = String(observation.value);\n } else {\n fhirObs.valueQuantity = quantity(observation.value as number);\n\n // Reference range only applies to quantitative values\n const referenceRange = buildReferenceRanges(observation, quantity);\n if (referenceRange.length > 0) fhirObs.referenceRange = referenceRange;\n }\n\n return fhirObs;\n}\n\n/**\n * Convert generic lab report to FHIR DiagnosticReport\n */\nexport function labReportToFHIR(\n report: LabReportData,\n patientId: string,\n observationIds: string[],\n): Addressable<FHIRDiagnosticReport> {\n // Map processing status to FHIR status\n let status: FHIRDiagnosticReport['status'];\n switch (report.processingStatus) {\n case 'complete':\n status = 'final';\n break;\n case 'partial':\n status = 'partial';\n break;\n case 'pending_review':\n status = 'preliminary';\n break;\n default:\n status = 'final';\n }\n\n return {\n category: [\n {\n coding: [\n {\n code: 'LAB',\n display: 'Laboratory',\n system: 'http://terminology.hl7.org/CodeSystem/v2-0074',\n },\n ],\n },\n ],\n code: {\n coding: [\n {\n code: '11502-2', // Laboratory report\n display: 'Laboratory report',\n system: 'http://loinc.org',\n },\n ],\n text: 'Laboratory Results',\n },\n conclusion:\n report.overallStatus === 'NORMAL'\n ? 'All results within normal limits'\n : 'One or more abnormal results detected',\n conclusionCode:\n report.overallStatus === 'ANORMAL'\n ? [\n {\n coding: [\n {\n code: 'A',\n display: 'Abnormal',\n system: 'http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation',\n },\n ],\n },\n ]\n : undefined,\n effectiveDateTime: report.collectionDate,\n id: report.reportId,\n issued: report.createdAt,\n performer: report.laboratoryName ? [{ display: report.laboratoryName }] : undefined,\n resourceType: 'DiagnosticReport',\n result: observationIds.map((id) => ({ reference: `Observation/${id}` })),\n status,\n subject: {\n reference: `Patient/${patientId}`,\n },\n };\n}\n\n/**\n * Convert user profile to FHIR Patient\n * NOTE: CPF is intentionally excluded for privacy (LGPD compliance)\n */\nexport function userProfileToFHIR(profile: UserProfileData): Addressable<FHIRPatient> {\n const nameParts = profile.name.split(' ');\n const given = nameParts.slice(0, -1);\n const family = nameParts[nameParts.length - 1] || '';\n\n return {\n address: profile.address\n ? [\n {\n city: profile.address.city,\n country: profile.address.country || 'BR',\n line: [\n profile.address.street && profile.address.number\n ? `${profile.address.street}, ${profile.address.number}`\n : profile.address.street,\n profile.address.complement,\n ].filter(Boolean) as string[],\n postalCode: profile.address.postalCode,\n state: profile.address.state,\n },\n ]\n : undefined,\n birthDate: profile.birthDate,\n gender: profile.gender,\n id: profile.userId,\n name: [\n {\n family,\n given: given.length > 0 ? given : undefined,\n text: profile.name,\n },\n ],\n resourceType: 'Patient',\n telecom:\n [\n ...(profile.email ? [{ system: 'email' as const, value: profile.email }] : []),\n ...(profile.phone ? [{ system: 'phone' as const, value: profile.phone }] : []),\n ].length > 0\n ? [\n ...(profile.email ? [{ system: 'email' as const, value: profile.email }] : []),\n ...(profile.phone ? [{ system: 'phone' as const, value: profile.phone }] : []),\n ]\n : undefined,\n };\n}\n\n/**\n * Convert complete lab result to FHIR Bundle\n * This is the main function for exporting lab results to FHIR R4 format\n */\nexport function labResultToFHIRBundle(\n report: LabReportData,\n observations: LabObservationData[],\n userProfile: UserProfileData,\n): FHIRBundle {\n const patientId = userProfile.userId;\n\n // Convert observations\n const fhirObservations = observations.map((obs) => {\n const resource = labObservationToFHIR(\n { ...obs, collectionDate: report.collectionDate },\n patientId,\n report.laboratoryName,\n );\n\n return { fullUrl: entryFullUrl(resource), resource };\n });\n\n // Os ids vêm dos recursos já montados, e não de uma segunda montagem da mesma\n // regra. O `DiagnosticReport.result` aponta para eles, e era aqui que a\n // referência se separava do recurso.\n const observationIds = fhirObservations.map((entry) => entry.resource.id);\n\n // Convert report\n const diagnosticReport = labReportToFHIR(report, patientId, observationIds);\n\n // Convert patient\n const fhirPatient = userProfileToFHIR(userProfile);\n\n return {\n entry: [\n { fullUrl: entryFullUrl(fhirPatient), resource: fhirPatient },\n { fullUrl: entryFullUrl(diagnosticReport), resource: diagnosticReport },\n ...fhirObservations,\n ],\n resourceType: 'Bundle',\n type: 'collection',\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAkCO,IAAM,kBAAkB;AAgBxB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AI,QAAQ,QAAQ,CAAC,EAAE,QAAQ,SAAkB,OAAO,QAAQ,MAAM,CAAC,IAAI,CAAC;AAAA,MAC5E,GAAI,QAAQ,QAAQ,CAAC,EAAE,QAAQ,SAAkB,OAAO,QAAQ,MAAM,CAAC,IAAI,CAAC;AAAA,IAC9E,IACA;AAAA,EACR;AACF;AAMO,SAAS,sBACd,QACA,cACA,aACY;AACZ,QAAM,YAAY,YAAY;AAG9B,QAAM,mBAAmB,aAAa,IAAI,CAAC,QAAQ;AACjD,UAAM,WAAW;AAAA,MACf,EAAE,GAAG,KAAK,gBAAgB,OAAO,eAAe;AAAA,MAChD;AAAA,MACA,OAAO;AAAA,IACT;AAEA,WAAO,EAAE,SAAS,aAAa,QAAQ,GAAG,SAAS;AAAA,EACrD,CAAC;AAKD,QAAM,iBAAiB,iBAAiB,IAAI,CAAC,UAAU,MAAM,SAAS,EAAE;AAGxE,QAAM,mBAAmB,gBAAgB,QAAQ,WAAW,cAAc;AAG1E,QAAM,cAAc,kBAAkB,WAAW;AAEjD,SAAO;AAAA,IACL,OAAO;AAAA,MACL,EAAE,SAAS,aAAa,WAAW,GAAG,UAAU,YAAY;AAAA,MAC5D,EAAE,SAAS,aAAa,gBAAgB,GAAG,UAAU,iBAAiB;AAAA,MACtE,GAAG;AAAA,IACL;AAAA,IACA,cAAc;AAAA,IACd,MAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk5RC7C7HJcjs = require('./chunk-5RC7C7HJ.cjs');
|
|
4
4
|
|
|
5
5
|
// src/reference-ranges.ts
|
|
6
6
|
var biomarkerRangeDefinitions = {
|
|
@@ -2013,7 +2013,7 @@ function applyFallbackReferenceRanges(biomarkers) {
|
|
|
2013
2013
|
}
|
|
2014
2014
|
const fallback = getFallbackReferenceRange(biomarker.code);
|
|
2015
2015
|
if (fallback) {
|
|
2016
|
-
const canonicalUnit =
|
|
2016
|
+
const canonicalUnit = _chunk5RC7C7HJcjs.getCanonicalUnit.call(void 0, biomarker.code);
|
|
2017
2017
|
const unitsMatch = !biomarker.unit || biomarker.unit.toLowerCase() === fallback.unit.toLowerCase() || canonicalUnit && biomarker.unit.toLowerCase() === canonicalUnit.toLowerCase() || // Handle common unit variations
|
|
2018
2018
|
biomarker.unit === "%" && fallback.unit === "%";
|
|
2019
2019
|
if (unitsMatch) {
|
|
@@ -2038,4 +2038,4 @@ function applyFallbackReferenceRanges(biomarkers) {
|
|
|
2038
2038
|
|
|
2039
2039
|
|
|
2040
2040
|
exports.biomarkerRangeDefinitions = biomarkerRangeDefinitions; exports.defaultReferenceRanges = defaultReferenceRanges; exports.getReferenceRange = getReferenceRange; exports.getRangeDirection = getRangeDirection; exports.getFallbackReferenceRange = getFallbackReferenceRange; exports.applyFallbackReferenceRanges = applyFallbackReferenceRanges;
|
|
2041
|
-
//# sourceMappingURL=chunk-
|
|
2041
|
+
//# sourceMappingURL=chunk-LXKFVJF4.cjs.map
|