TABLE OF CONTENTS
Sample POST command for submitting a Patient:
curl <https://kayatest.gocovid-19.org/service/api/fhir/Patient> -H "authorization: Bearer [*****](<https://www.notion.so/How-to-get-a-new-access-token-720d8fcd41a34028a927c1e67cb7348a>)" -H "content-type: application/json" -k -d @kayapatient.json
Sample Patient resource:
{
"resourceType":"Patient",
"name":[
{
"use":"official",
"family":"Rizal", //**required**, Patient's last name
"given":[ //**required**, Patient's given name, separated per word (required)
"Jose",
"Protacio" //for middle name, check middleName extension
],
"suffix": [
"01" // Suffix: 1 for Jr., 2 for Sr., 3 for I, 4 for II, 5 for III, 6 for IV, 7 for V
]
}
],
"telecom":[ //can have multiple entries, with different telecom types (PermanentMobile, CurrentMobile, PermanentPhone, CurrentPhone, PermanentEmail, CurrentEmail)
// Only current mobile number is required, see examples below.
{
"system":"phone",
"value":"09507775854", //**required**, current mobile number
"extension":[
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/telecomType>",
"valueString":"CurrentMobile"
}
]
},
{
"system":"phone", //phone or email
"value":"09507775853", //Patient's phone number or email address
"extension":[
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/telecomType>", //no need to modify url's, you may treat these as "labels"
"valueString":"PermanentMobile" //see possible types specified above
}
]
},
{
"system":"phone",
"value":"(03) 5555 6473",
"extension":[
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/telecomType>",
"valueString":"PermanentPhone"
}
]
},
{
"system":"phone",
"value":"(03) 5555 6474",
"extension":[
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/telecomType>",
"valueString":"CurrentPhone"
}
]
},
{
"system":"email",
"value":"[email protected]",
"extension":[
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/telecomType>",
"valueString":"PermanentEmail"
}
]
},
{
"system":"email",
"value":"[email protected]",
"extension":[
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/telecomType>",
"valueString":"CurrentEmail"
}
]
}
],
"gender":"male", //**required**
"birthDate":"1961-06-19", //**required**, YYYY-MM-DD
"extension":[
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/middleName>",
"valueString": "Realonda" //**required**, Patient's middle name (if not supplied, use "-"/hyphen)
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/age>",
"valueString": "33" //Patient's age
},{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/nationality>",
"valueString":"Filipino" //**required**, Patient's nationality
},
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/civilStatus>",
"valueString":"02" //01 for Single, 02 for Married, 03 for Divorced, 04 for Separated, 05 for Widowed
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/healthNumber>",
"valueString": "HN123" //PhilHealth number
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/healthWorker>",
"valueString": "01" //**required**, Is patient a health worker? answer is either 01 for yes or 02 for no
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/regionOfDiseaseReportingUnit>",
"valueString": "NCR" //Region of DRU
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/provinceOfDiseaseReportingUnit>",
"valueString": "NCR" //Province of DRU
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/cityOfDiseaseReportingUnit>",
"valueString": "Mandaluyong" //City of DRU
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/nameOfDiseaseReportingUnit>",
"valueString": "CovidX123" //**required**, Name of DRU
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/nameOfOtherReportingUnit>",
"valueString": "CovidY456" //Name of other reporting unit
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/datetimeUpDated>",
"valueString": "2020-08-05" //Date this record is updated
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/returningOverseasFilipiNo>",
"valueString": "01" //**required**, Is patient a returning OFW? answer is either 01 for yes or 02 for no
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/sampleCollectionRecommended>",
"valueString": "01" //**required**, Is sample collection recommended? answer is either 01 for yes or 02 for no
},
{
"url": "<http://xcrfg.cvo/fhir/StructureDefinition/dateInterviewed>",
"valueString": "2020-08-25" //**required**, Date patient is interviewed
}
],
"address":[ //can have more than one entry, with different address types(Permanent, Current, Outside Philippines)
// Only current address is required, see examples below.
{
"line":[
"Sierra Madre St" //Current Address - House No/Lot/Bldg
],
"city":"Mandaluyong City", //Current Address - City
"district":"NCR, Second District", //Current Address - Province
"state":"NCR", //Current Address - Region
"postalCode":"1550", //Current Address - Postal code
"extension":[
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/addressType>",
"valueString":"Current" //**required**
},
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/Barangay>",
"valueString":"141102040" //**required**, 9-digit code (prepend with 0), see link on PSGC Coding Rules above
},
{
"url":"<http://hl7.org/fhir/StructureDefinition/geolocation>",
"extension":[
{
"url":"latitude",
"valueDecimal":100.1
},
{
"url":"longitude",
"valueDecimal":100.1
}
]
}
]
},
{
"line":[
"Sierra Madre St"
],
"city":"Mandaluyong City",
"district":"NCR,Second District",
"state":"NCR",
"postalCode":"1550",
"extension":[
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/addressType>",
"valueString":"Permanent"
},
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/Barangay>",
"valueString":"141102040" //see link on PSGC Coding Rules above
},
{
"url":"<http://hl7.org/fhir/StructureDefinition/geolocation>",
"extension":[
{
"url":"latitude",
"valueDecimal":100.1 //required
},
{
"url":"longitude",
"valueDecimal":100.1 //required
}
]
}
]
},
{
"line":[
"139 Lily St"
],
"city":"Angeles City",
"district":"Pampanga",
"state":"Region 3",
"postalCode":"3999",
"country":"USA",
"extension":[
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/addressType>",
"valueString":"OutsidePhilippines"
},
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/WorkPlace>",
"valueString":"SOME BANK"
},
{
"url":"<http://xcrfg.cvo/fhir/StructureDefinition/EmployersName>",
"valueString":"SOMEONE AT BANK"
},
{
"url":"<http://hl7.org/fhir/StructureDefinition/geolocation>",
"extension":[
{
"url":"latitude",
"valueDecimal":100.1
},
{
"url":"longitude",
"valueDecimal":100.1
}
]
}
]
}
]
}
Response would be exactly the same as the payload, except for some additional fields:
{
"resourceType": "Patient",
"id": "P1l8ovWnFd",
"meta": {
"versionId": "1",
"lastUpdated": "2020-08-27T02:41:50.072-06:00"
},
...
In case of duplicate records (i.e. Patient with same name, birthdate, and gender), response will be similar to this:
{
"Error": {
"duplicate records": [
"BZoKhXWgTd",
"seFbNlJSJ0",
"JSnIFZ7wtB"
],
"message": "Found the case with same name, family name, date of birth and gender"
}
}