Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modules/hl7v2/Hl7v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
const SEXO_OTRO_HL7 = 'O';
const USE_DNI_ID = true;

function normalizeIdentifierEntity(entity: string = ''): string {

Check failure on line 20 in modules/hl7v2/Hl7v2.ts

View workflow job for this annotation

GitHub Actions / build

Type string trivially inferred from a string literal, remove type annotation
return entity.replace(/\s+/g, '');
}

interface PatientIdentifier {
identificador: string;
assigning_authority: string;
Expand Down Expand Up @@ -73,7 +77,9 @@
});

// Controlar que no lo tenga y agregarlo si es necesario
if (!paciente.identificadores?.some(id => id.entidad === IDENTIFIER_ENTITY_ANDESHL7V2 && id.valor === hl7id)) {
if (!paciente.identificadores?.some(id =>
normalizeIdentifierEntity(id.entidad) === IDENTIFIER_ENTITY_ANDESHL7V2 && id.valor === hl7id
)) {
if (!paciente.identificadores) {
paciente.identificadores = [];
}
Expand Down
Loading