Sample API Calls

Alternative Sample API

https://pczuniga.notion.site/Sample-API-Calls-for-PH-CDI-5bb27157940347da81e1252b74cd1ee8

Implementation Guide FHIR Endpoint:

https://fhir.simplifier.net/Implementation-Guide-for-NHDR

Get all patients in the FHIR server

Sample cURL request

curl --location 'https://fhir.simplifier.net/Implementation-Guide-for-NHDR/Patient' 

Replace the <resource> variable in the URL baseurl/<resource> with the desired resource type if you want to search for other resources. For example, to retrieve data for practitioners, use baseurl/Practitioner.

Sample Response

{
    "resourceType": "Bundle",
    "type": "searchset",
    "timestamp": "2024-07-15T00:04:37.439+00:00",
    "meta": {
        "lastUpdated": "2024-07-15T00:04:37.439+00:00",
        "versionId": "ad512d0b-8fbe-41e4-8635-c4fbc38b18c6"
    },
    "entry": [
        {
            "fullUrl": "https://fhir.simplifier.net/Implementation-Guide-for-NHDR/Patient/926ac996-1ed4-48c3-928b-1beb8b21e4fe",
            "search": {
                "mode": "match"
            },
            "resource": {
                "resourceType": "Patient",
                "meta": {
                    "lastUpdated": "2024-07-12T14:07:16.407+00:00",
                    "profile": [
                        "https://fake-acme.org/fhir/StructureDefinition/ACME-base-patient"
                    ],
                    "versionId": "1"
                },
                "implicitRules": "http://hl7.org/fhir/reference",
                "language": "en-IN",
                "text": {
                    "status": "extensions",
                    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Hello world!</div>"
                },
                "identifier": [
                    {
                        "use": "usual",
                        "system": "http://www.acme.com/identifiers/patient",
                        "value": "123456"
                    }
                ],
                "active": true,
                "name": [
                    {
                        "use": "official",
                        "text": "Example Patient",
                        "family": "Patient",
                        "given": [
                            "Example"
                        ]
                    }
                ],
                "telecom": [
                    {
                        "system": "phone",
                        "value": "abc",
                        "use": "home"
                    }
                ],
                "gender": "other",
                "deceasedBoolean": false,
                "address": [
                    {
                        "use": "home",
                        "type": "both",
                        "text": "137 Nowhere Street, Erewhon 9132",
                        "line": [
                            "137 Nowhere Street"
                        ],
                        "city": "Erewhon",
                        "district": "Madison",
                        "state": "abc",
                        "postalCode": "9132",
                        "country": "abc"
                    }
                ],
                "maritalStatus": {
                    "text": "abc"
                },
                "multipleBirthBoolean": false,
                "photo": [
                    {
                        "contentType": "text/plain; charset=UTF-8, image/png",
                        "language": "en-AU",
                        "url": "http://www.acme.com/logo-small.png",
                        "size": 1037423195,
                        "title": "Official Corporate Logo",
                        "creation": "1984-05-06T14:42:00+00:00"
                    }
                ],
                "managingOrganization": {
                    "reference": "https://fhir.simplifier.net/Implementation-Guide-for-NHDR/abc",
                    "display": "abc"
                },
                "id": "926ac996-1ed4-48c3-928b-1beb8b21e4fe"
            }
        },
        {
            "fullUrl": "https://fhir.simplifier.net/Implementation-Guide-for-NHDR/Patient/c12d733b-e50d-48f5-9890-454e510cbc0c",
            "search": {
                "mode": "match"
            },
            "resource": {
                "resourceType": "Patient",
                "meta": {
                    "lastUpdated": "2024-07-14T08:12:09.640+00:00",
                    "versionId": "1"
                },
                "identifier": [
                    {
                        "system": "http://acme.org/mrns",
                        "value": "12345"
                    }
                ],
                "name": [
                    {
                        "family": "Jameson",
                        "given": [
                            "J",
                            "Jonah"
                        ]
                    }
                ],
                "gender": "male",
                "id": "c12d733b-e50d-48f5-9890-454e510cbc0c"
            }
        },
        {
            "fullUrl": "https://fhir.simplifier.net/Implementation-Guide-for-NHDR/Patient/1224b60f-ae1c-499d-baed-3c1b441e05b9",
            "search": {
                "mode": "match"
            },
            "resource": {
                "resourceType": "Patient",
                "meta": {
                    "lastUpdated": "2024-07-14T12:15:00.878+00:00",
                    "versionId": "1"
                },
                "identifier": [
                    {
                        "system": "http://acme.org/mrns",
                        "value": "12345"
                    }
                ],
                "name": [
                    {
                        "family": "Jameson",
                        "given": [
                            "J",
                            "Jonas"
                        ]
                    }
                ],
                "gender": "male",
                "id": "1224b60f-ae1c-499d-baed-3c1b441e05b9"
            }
        },
        {
            "fullUrl": "https://fhir.simplifier.net/Implementation-Guide-for-NHDR/Patient/smartTranBundlePatient1",
            "search": {
                "mode": "match"
            },
            "resource": {
                "resourceType": "Patient",
                "id": "smartTranBundlePatient1",
                "meta": {
                    "lastUpdated": "2024-07-14T13:10:00.305+00:00",
                    "versionId": "20"
                },
                "text": {
                    "status": "generated",
                    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some narrative</div>"
                },
                "active": true,
                "name": [
                    {
                        "use": "official",
                        "family": "Chalmers",
                        "given": [
                            "Petwwwwwwer",
                            "James"
                        ]
                    }
                ],
                "gender": "male",
                "birthDate": "1974-12-25"
            }
        },
        {
            "fullUrl": "https://fhir.simplifier.net/Implementation-Guide-for-NHDR/Patient/smartTranBundlePatient2",
            "search": {
                "mode": "match"
            },
            "resource": {
                "resourceType": "Patient",
                "id": "smartTranBundlePatient2",
                "meta": {
                    "lastUpdated": "2024-07-14T13:03:39.965+00:00",
                    "versionId": "8"
                },
                "text": {
                    "status": "generated",
                    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some narrative</div>"
                },
                "identifier": [
                    {
                        "system": "http:/example.org/fhir/ids",
                        "value": "234234"
                    }
                ],
                "active": true,
                "name": [
                    {
                        "use": "official",
                        "family": "Chalmers",
                        "given": [
                            "Peter",
                            "JameeeeSSSSeees"
                        ]
                    }
                ],
                "gender": "male",
                "birthDate": "1974-12-25"
            }
        },
        {
            "fullUrl": "https://fhir.simplifier.net/Implementation-Guide-for-NHDR/Practitioner/smartTranBundlePatient3",
            "search": {
                "mode": "match"
            },
            "resource": {
                "resourceType": "Practitioner",
                "id": "smartTranBundlePatient3",
                "meta": {
                    "lastUpdated": "2024-07-14T13:07:16.555+00:00",
                    "versionId": "3"
                },
                "text": {
                    "status": "generated",
                    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some narrative</div>"
                },
                "identifier": [
                    {
                        "system": "http:/example.org/fhir/ids",
                        "value": "234234"
                    }
                ],
                "active": true,
                "name": [
                    {
                        "use": "official",
                        "family": "Chalmers",
                        "given": [
                            "Peter",
                            "JameeeeSSSSeees"
                        ]
                    }
                ],
                "gender": "male",
                "birthDate": "1974-12-25"
            }
        }
    ],
    "total": 6,
    "link": [
        {
            "relation": "self",
            "url": "https://fhir.simplifier.net/Implementation-Guide-for-NHDR/Patient?_total=accurate&_count=20&_skip=0"
        }
    ],
    "id": "cf89b4a0-0f20-4fe6-b27f-9360a2dcba0f"
}

Get a specific patient from the FHIR server

Sample cURL request

curl --location 'https://fhir.simplifier.net/Implementation-Guide-for-NHDR/Patient/926ac996-1ed4-48c3-928b-1beb8b21e4fe' 

Replace the <id> variable in the URL baseurl/<resource>/<id> with the used ID. Other possible search parameters can be implemented. Please see relevant FHIR documentation to learn about the different search parameters.

Sample Response

{
  "resourceType": "Patient",
  "meta": {
    "lastUpdated": "2024-07-12T14:07:16.407+00:00",
    "profile": [
      "https://fake-acme.org/fhir/StructureDefinition/ACME-base-patient"
    ],
    "versionId": "1"
  },
  "implicitRules": "http://hl7.org/fhir/reference",
  "language": "en-IN",
  "text": {
    "status": "extensions",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Hello world!</div>"
  },
  "identifier": [
    {
      "use": "usual",
      "system": "http://www.acme.com/identifiers/patient",
      "value": "123456"
    }
  ],
  "active": true,
  "name": [
    {
      "use": "official",
      "text": "Example Patient",
      "family": "Patient",
      "given": [
        "Example"
      ]
    }
  ],
  "telecom": [
    {
      "system": "phone",
      "value": "abc",
      "use": "home"
    }
  ],
  "gender": "other",
  "deceasedBoolean": false,
  "address": [
    {
      "use": "home",
      "type": "both",
      "text": "137 Nowhere Street, Erewhon 9132",
      "line": [
        "137 Nowhere Street"
      ],
      "city": "Erewhon",
      "district": "Madison",
      "state": "abc",
      "postalCode": "9132",
      "country": "abc"
    }
  ],
  "maritalStatus": {
    "text": "abc"
  },
  "multipleBirthBoolean": false,
  "photo": [
    {
      "contentType": "text/plain; charset=UTF-8, image/png",
      "language": "en-AU",
      "url": "http://www.acme.com/logo-small.png",
      "size": 1037423195,
      "title": "Official Corporate Logo",
      "creation": "1984-05-06T14:42:00+00:00"
    }
  ],
  "managingOrganization": {
    "reference": "https://fhir.simplifier.net/Implementation-Guide-for-NHDR/abc",
    "display": "abc"
  },
  "id": "926ac996-1ed4-48c3-928b-1beb8b21e4fe"
}

Submit new Patient data to a FHIR server

curl --location 'https://fhir.simplifier.net/Implementation-Guide-for-NHDR/Patient' \
--header 'Accept: application/fhir+json' \
--header 'Content-Type: application/fhir+json' \
--header 'Authorization: Basic cGN6dW5pZ2FAdXAuZWR1LnBoOkF1Z3VzdDI0UGlwYXk=' \
--header 'Cookie: ARRAffinity=712573b2262d6f13b0ef4166eac9b1b56a8512d94aeafa1ae0da22063008fe09; ARRAffinitySameSite=712573b2262d6f13b0ef4166eac9b1b56a8512d94aeafa1ae0da22063008fe09' \
--data '{
                "resourceType": "Patient",
                "meta": {
                    "lastUpdated": "2024-07-14T08:12:09.640+00:00",
                    "versionId": "1"
                },
                "identifier": [
                    {
                        "system": "http://acme.org/mrns",
                        "value": "12345"
                    }
                ],
                "name": [
                    {
                        "family": "Jameson",
                        "given": [
                            "P",
                            "Marcus"
                        ]
                    }
                ],
                "gender": "male",
                "id": "c12d733b-e50d-48f5-9890-454e510cbc0c"
            }
        }
    ],'

Alternative Sample API

https://pczuniga.notion.site/Sample-API-Calls-for-PH-CDI-5bb27157940347da81e1252b74cd1ee8