Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Commit

Permalink
Add Specimen
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkiel committed Apr 28, 2019
1 parent cbe099c commit 8900d59
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/life_fhir_gen/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,19 @@
:subject {:reference (str "Patient/" patient-index)}
:type
{:coding
[]}
[{:system "http://germanbiobanknode.de/fhir/code-systems/sample-liquid"
:code type}]}
:collection
{:collectedDateTime (str date)}})

(defn gen-specimen-tissue [patient-index encounter-index date type]
{:resourceType "Specimen"
:id (str patient-index "-" encounter-index "-" type)
:subject {:reference (str "Patient/" patient-index)}
:type
{:coding
[{:system "http://germanbiobanknode.de/fhir/code-systems/sample-tissue"
:code type}]}
:collection
{:collectedDateTime (str date)}})

Expand All @@ -150,7 +162,7 @@
{:resource
resource
:request
{:method "POST"
{:method "PUT"
:url (str resourceType "/" id)}})


Expand All @@ -170,7 +182,13 @@
patient-index encounter-index date
bmi)
(gen-smoker-observation
patient-index encounter-index date)]))
patient-index encounter-index date)
(gen-specimen-liquid
patient-index encounter-index date
(rand-nth ["whole-blood" "plasma" "serum" "urine" "saliva"]))
(gen-specimen-tissue
patient-index encounter-index date
(rand-nth ["formalin" "frozen" "other"]))]))


(defn gen-patients-with-observations
Expand Down

0 comments on commit 8900d59

Please sign in to comment.