Skip to content

Commit

Permalink
feat: recovery healthcert schema v2.0 (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
HJunyuan authored Mar 25, 2022
1 parent fdedb36 commit 213dc28
Show file tree
Hide file tree
Showing 5 changed files with 439 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import * as pdtHealthCertV2 from "./__generated__/sg/gov/moh/pdt-healthcert/2.0/
import * as vaccinationHealthcert from "./__generated__/sg/gov/moh/vaccination-healthcert/1.0/schema";

import * as pdtHealthCertV2Schema from "./sg/gov/moh/pdt-healthcert/2.0";
import * as recHealthCertV2Schema from "./sg/gov/moh/recovery-healthcert/2.0";
import * as fhirSchema from "./sg/gov/moh/fhir/4.0.1";

export { geekout, notarise, pdtHealthCertV2, vaccinationHealthcert, pdtHealthCertV2Schema, fhirSchema };
export {
geekout,
notarise,
pdtHealthCertV2,
vaccinationHealthcert,
pdtHealthCertV2Schema,
recHealthCertV2Schema,
fhirSchema
};
3 changes: 3 additions & 0 deletions src/sg/gov/moh/recovery-healthcert/2.0/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import schema from "./schema.json";

export { schema };
157 changes: 157 additions & 0 deletions src/sg/gov/moh/recovery-healthcert/2.0/sample-document.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"id": "76caf3f9-5591-4ef1-b756-1cb47a76dede",
"version": "rec-healthcert-v2.0",
"type": "PCR",
"validFrom": "2022-03-12T04:30:35.065Z",
"validUntil": "2023-08-28T04:30:35.065Z",
"fhirVersion": "4.0.1",
"fhirBundle": {
"resourceType": "Bundle",
"type": "collection",
"entry": [
{
"fullUrl": "urn:uuid:ba7b7c8d-c509-4d9d-be4e-f99b6de29e23",
"resource": {
"resourceType": "Patient",
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/patient-nationality",
"extension": [
{
"url": "code",
"valueCodeableConcept": {
"text": "Patient Nationality",
"coding": [{ "system": "urn:iso:std:iso:3166", "code": "SG" }]
}
}
]
}
],
"identifier": [
{
"id": "PPN",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "PPN",
"display": "Passport Number"
}
]
},
"value": "E7831177G"
},
{ "id": "NRIC-FIN", "value": "S9098989Z" }
],
"name": [{ "text": "Tan Chen Chen" }],
"gender": "female",
"birthDate": "1990-01-15"
}
},
{
"fullUrl": "urn:uuid:7729970e-ab26-469f-b3e5-36a42ec24146",
"resource": {
"resourceType": "Observation",
"specimen": {
"type": "Specimen",
"reference": "urn:uuid:0275bfaf-48fb-44e0-80cd-9c504f80e6ae"
},
"identifier": [
{
"id": "ACSN",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "ACSN",
"display": "Accession ID"
}
]
},
"value": "123456789"
}
],
"category": [
{
"coding": [
{
"system": "http://snomed.info/sct",
"code": "840539006",
"display": "COVID-19"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "94531-1",
"display": "SARS-CoV-2 (COVID-19) RNA panel - Respiratory specimen by NAA with probe detection"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "260385009",
"display": "Positive"
}
]
},
"effectiveDateTime": "2022-03-01T04:30:35.065Z",
"status": "final"
}
},
{
"fullUrl": "urn:uuid:0275bfaf-48fb-44e0-80cd-9c504f80e6ae",
"resource": {
"resourceType": "Specimen",
"type": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "258500001",
"display": "Nasopharyngeal swab"
}
]
},
"collection": { "collectedDateTime": "2022-03-01T04:30:35.065Z" }
}
},
{
"fullUrl": "urn:uuid:bc7065ee-42aa-473a-a614-afd8a7b30b1e",
"resource": {
"resourceType": "Organization",
"name": "Ministry of Health (MOH)",
"type": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/organization-type",
"code": "govt",
"display": "Government"
}
]
}
],
"contact": [
{
"telecom": [
{ "system": "url", "value": "https://www.moh.gov.sg" },
{ "system": "phone", "value": "+6563259220" }
],
"address": {
"type": "physical",
"use": "work",
"text": "Ministry of Health, 16 College Road, College of Medicine Building, Singapore 169854"
}
}
]
}
}
]
},
"logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAADICAMAAAApx+PaAAAAM1BMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzeCmiAAAAAEHRSTlMAQL+A7xAgn2DP3zBwr1CPEl+I/QAABwdJREFUeNrsnd122yoQRvkHISHN+z/tyUk9oTECQ1bTBc23byNs0B5GIDARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAk+Ik+Idx4g5N4B9GQ/rPA9J/IPfSgwL/MEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwP5ZPoP5r7FJKAf7cufBihPNSkX5hlA9u+DsP7dX/JK1P2VPiSIoebErLwVh5Zx+8C1Y22YtP0Fpf6hdea+mq1Wlixfej6RcDxj09swXbbeBQpijug20aj/SE8bvo5hEuavAuSKpQfJxTG91gUrCV6jSQE0oPke4wuke705EqpLNWxtMtSk4jvXGld+tLlxvVMNnakD7mEndYTVWSnV860WUXl34RMy7BempyGzN7pAbmXEA6bfvK0u32uTFKKVM0r0Yw1MTcFvp8iVLPD0+9gHQy+7rSf3eejp2HuFcsmldiEz0FzKXfSRw3qe08Xqd9dP6QKONnku4lG3NSb/RBtKtKt1ttdBJiYb2VI7brc7tc8IYotJzHUB0c+O+T3rTQuLKsZRqpzkTS7dZI4vo+qJndEGO8Ezecyjac6/ITN2KOWaULIT/aLdeUnqpdi7VW2+Kyc29FL3s7e3hi5LTSheWWpyWlH4XzmvWjniOiFN3YWDivWI92Wuk5ct2C0p3Jzl9YN66WI5IV/VyF86r1a17pH5UMC0pX/DwXVU524Ks5YgDZmL4zGz1w80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tnM65j1SLH+wXVG6jc0DYI986FujKJnQLV0c1Mrw7sO5n/fwwDfkoj9gfD4ozhyFAUVMqBRlYrCd0oUnRrkiyEzOPFNLFzTzT5VlBXd3Om8ozkBtOOdDPZkU9k9/PCpLkHarnZUfIhXOv0/6ISv0SOcvj/1b9tzfkN5G3x7ebdIh34WfF6tpDrrYK6PUpd/4fJS3bpXartOJN+SRDBXOv0l6m6EzZ1z35lw9k3RO01WMFBU4H4+21lMbb8Xs0vlvYVHp3PUqKCcaODUsnbNLSR5cTC+dZ+ppVelCnKa117eNTNQkSVFiU2tP+QrSOVvZZaULqwvtPCh/jdMb3RN99QOkojv8LsQS0k/O7+tKf+NMT96NP0UvLvinRm9Jn24wVrbDCbGIdF4xVBNJ/xJSe6Ueo/Bj/9I/7Dy0PvrnJy5opSIRRZX0aQUAAPzX3h3UAACAQAx7YAD/anFBCNdamIABAAAAAAAAAAAAAAAAAAAAAAAAAADAmmoeK9HziB5I9EBXnx8AAAAAAAAAALBmAIZKmzWInxyOAAAAAElFTkSuQmCC"
}
47 changes: 47 additions & 0 deletions src/sg/gov/moh/recovery-healthcert/2.0/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemata.openattestation.com/sg/gov/moh/pdt-healthcert/2.0/schema.json",
"type": "object",
"required": ["id", "version", "type", "validFrom", "validUntil", "fhirVersion", "fhirBundle"],
"definitions": {
"RecTypes": {
"type": "string",
"enum": ["PCR", "ART", "SER"]
}
},
"properties": {
"id": {
"type": "string",
"examples": ["TEST001"]
},
"version": {
"type": "string",
"enum": ["rec-healthcert-v2.0"]
},
"type": {
"$ref": "#/definitions/RecTypes"
},
"logo": {
"type": "string",
"description": "base64 encoded image"
},
"validFrom": {
"type": "string",
"format": "date-time",
"description": "Date and time from which the document is considered valid"
},
"validUntil": {
"type": "string",
"format": "date-time",
"description": "Date and time after which the document is considered invalid"
},
"fhirVersion": {
"type": "string",
"examples": ["4.0.1"]
},
"fhirBundle": {
"$ref": "https://schemata.openattestation.com/sg/gov/moh/fhir/4.0.1/lite-schema.json#/definitions/Bundle",
"description": "FHIR bundle for a collection of resources. Each resource and the entire bundle should be compliant against the base spec of FHIR. You may use a validator like: https://inferno.healthit.gov/validator/"
}
}
}
Loading

0 comments on commit 213dc28

Please sign in to comment.