-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from samply/develop
exliquid
- Loading branch information
Showing
4 changed files
with
41 additions
and
21 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,39 @@ | ||
define InInitialPopulation: exists ExliquidSpecimenWithAliquot and | ||
define InInitialPopulation: | ||
exists AnySpecimen | ||
|
||
define AnySpecimen: | ||
[Specimen] S | ||
|
||
define retrieveCondition: | ||
First(from [Condition] C | ||
return ('{\"subject_reference\": \"' + C.subject.reference | ||
+ '\", \"diagnosis_code\": \"' | ||
+ C.code.coding.where(system = 'http://fhir.de/CodeSystem/bfarm/icd-10-gm').code.first() | ||
+ '\"}' | ||
)) | ||
|
||
define Diagnosis: | ||
if (retrieveCondition is null) then '{\"subject_reference\": \"\", \"diagnosis_code\": \"\"}' | ||
else retrieveCondition | ||
|
||
define function getSampletype(specimen FHIR.Specimen): | ||
if (not exists specimen.type.coding.where(system = 'https://fhir.bbmri.de/CodeSystem/SampleMaterialType').code) then 'null' | ||
else specimen.type.coding.where(system = 'https://fhir.bbmri.de/CodeSystem/SampleMaterialType').code.first() | ||
|
||
define function getRestamount(specimen FHIR.Specimen): | ||
if (not exists specimen.collection.quantity.value) then '0' else specimen.collection.quantity.value.toString() | ||
|
||
define function getParentReference(specimen FHIR.Specimen): | ||
if (not exists specimen.parent.reference) then 'null' else specimen.parent.reference | ||
|
||
define function getSubjectReference(specimen FHIR.Specimen): | ||
if (not exists specimen.subject.reference) then 'null' else specimen.subject.reference | ||
|
||
define function SingleStrat(specimen FHIR.Specimen): | ||
'{"specimen_id": "' + specimen.id + | ||
'", "sampletype": "' + getSampletype(specimen) + | ||
'", "exliquid_tag": ' + (specimen.identifier.system contains 'http://dktk.dkfz.de/fhir/sid/exliquid-specimen').toString() + | ||
', "rest_amount": "' + getRestamount(specimen) + | ||
'", "parent_reference": "' + getParentReference(specimen) + | ||
'", "subject_reference": "' + getSubjectReference(specimen) + | ||
'"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters