Skip to content

Commit 743e1e2

Browse files
committed
fix: conversion de Andes Ranking base 0 a FHIR Rank en base 1
1 parent a0e7c0c commit 743e1e2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/lib/practitioner.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
AndesRelacion
1515
} from '../types/andes/practitioner.types';
1616
import { formatFHIRDateTime, formatFHIRDate } from '../utils/fhirDate';
17+
import { mapAndesRankingToFhirRank } from '../utils/rankingMapping';
1718

1819
export function encode(practitioner: AndesPractitioner | null | undefined): Practitioner | null {
1920
const data = practitioner;
@@ -52,7 +53,7 @@ export function encode(practitioner: AndesPractitioner | null | undefined): Prac
5253
const contactos: ContactPoint[] = (data.contacto ?? []).map((unContacto: AndesContacto): ContactPoint => {
5354
const cont: ContactPoint = {
5455
value: unContacto.valor,
55-
rank: unContacto.ranking
56+
rank: mapAndesRankingToFhirRank(unContacto.ranking)
5657
};
5758

5859
switch (unContacto.tipo) {
@@ -206,6 +207,7 @@ export function encode(practitioner: AndesPractitioner | null | undefined): Prac
206207
// -----------------------------
207208
const profesionalFHIR: Practitioner = {
208209
resourceType: 'Practitioner',
210+
id: data._id,
209211
identifier: identificadores,
210212
active: data.habilitado ?? undefined,
211213
name: [{

0 commit comments

Comments
 (0)