Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement saving and loading of externalID #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 17 additions & 2 deletions src/script/GA4GHFHIRConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,9 @@ GA4GHFHIRConverter.extractDataFromObservation = function (observationResource, n
let nodeData = nodeDataLookup[familyMember];

let fhirTerminologyHelper = editor.getFhirTerminologyHelper();

let foundCode = false;

if (observationResource.valueCodeableConcept) {
for (const coding of observationResource.valueCodeableConcept.coding) {
if (coding.system === 'http://snomed.info/sct' && coding.code === '87955000') {
Expand Down Expand Up @@ -603,6 +603,13 @@ GA4GHFHIRConverter.extractDataFromPatient = function (patientResource,
properties.gender = 'F';
}

if (patientResource.identifier) {
if (patientResource.identifier.system ===
'https://github.com/phenotips/open-pedigree?externalID') {
properties.externalID = patientResource.identifier.value;
}
}

const dateTimeSplitter = /([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?/;
const nameUseOrder = ['anonymous', 'temp', 'expired_nickname', 'expired_', 'expired_usual', 'expired_official', 'maiden', 'old', 'nickname', '', 'usual', 'official'];
let maxFNameUse = -2;
Expand Down Expand Up @@ -1281,6 +1288,14 @@ GA4GHFHIRConverter.buildPedigreeIndividual = function (containedId, nodeProperti
}
}
}

if (nodeProperties.externalID) {
patientResource.identifier = {
'system': 'https://github.com/phenotips/open-pedigree?externalID',
'value': nodeProperties.externalID
};
}

return patientResource;
};

Expand Down