Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

satusehat: add job examples #651

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions adaptors/library/jobs/satusehat-create-bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Create a bundle in Satusehat with the given entries
fn(state => {
state.bundleEntry = [
{
fullUrl: 'urn:uuid:51def515efd04bb98bd007c77375bf4f',
request: {
method: 'POST',
url: 'Observation',
},
resource: {
category: [
{
coding: [
{
code: 'vital-signs',
display: 'Vital Signs',
system:
'http://terminology.hl7.org/CodeSystem/observation-category',
},
],
},
],
code: {
coding: [
{
code: '8462-4',
display: 'Diastolic blood pressure',
system: 'http://loinc.org',
},
],
},
effectiveDateTime: '2024-08-14T00:00:00.000Z',
encounter: {
display:
"Kopi lihdia daripada aku aku's patient_intake on 2024-08-14",
reference: 'Encounter/f09c268c-f0bd-4b37-9234-ffad2863eee1',
},
performer: [
{
reference: 'Practitioner/N10000003',
},
],
resourceType: 'Observation',
status: 'final',
subject: {
reference: 'Patient/P024783798934',
},
valueQuantity: {
code: 'mm[Hg]',
system: 'http://unitsofmeasure.org',
unit: 'mm[Hg]',
value: 80,
},
},
},
];

return state;
});

post('/', {
resourceType: 'Bundle',
type: 'transaction',
entry: $.bundleEntry,
});
62 changes: 62 additions & 0 deletions adaptors/library/jobs/satusehat-create-encounter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
post('Encounter', {
resourceType: 'Encounter',
status: 'arrived',
class: {
system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode',
code: 'AMB',
display: 'ambulatory',
},
subject: {
reference: 'Patient/100000030009',
display: 'Budi Santoso',
},
participant: [
{
type: [
{
coding: [
{
system:
'http://terminology.hl7.org/CodeSystem/v3-ParticipationType',
code: 'ATND',
display: 'attender',
},
],
},
],
individual: {
reference: 'Practitioner/N10000001',
display: 'Dokter Bronsig',
},
},
],
period: {
start: '2022-06-14T07:00:00+07:00',
},
location: [
{
location: {
reference: 'Location/b017aa54-f1df-4ec2-9d84-8823815d7228',
display:
'Ruang 1A, Poliklinik Bedah Rawat Jalan Terpadu, Lantai 2, Gedung G',
},
},
],
statusHistory: [
{
status: 'arrived',
period: {
start: '2022-06-14T07:00:00+07:00',
},
},
],
serviceProvider: {
reference: 'Organization/{{Org_id}}',
},
identifier: [
{
system: 'http://sys-ids.kemkes.go.id/encounter/{{Org_id}}',
value: 'P20240001',
},
],
});
10 changes: 10 additions & 0 deletions adaptors/library/staticExamples.json
Original file line number Diff line number Diff line change
@@ -61,6 +61,16 @@
"adaptor": "salesforce",
"name": "Create SMS linked to contact"
},
{
"expressionPath": "jobs/satusehat-create-bundle",
"adaptor": "satusehat",
"name": "Create a Bundle record"
},
{
"expressionPath": "jobs/satusehat-create-encounter",
"adaptor": "satusehat",
"name": "Create an Encounter record"
},
{
"expressionPath": "jobs/DHIS2-DataValues-API",
"adaptor": "dhis2",
7 changes: 5 additions & 2 deletions adaptors/satusehat.md
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ exchange

The following example shows a HTTP POST request to creating an `Encounter` FHIR
resource. Data was taken from the
[Satusehate Postman Collection](https://www.postman.com/satusehat/satusehat-public/request/56uan96/encounter-create)
[Satusehat Postman Collection](https://www.postman.com/satusehat/satusehat-public/request/56uan96/encounter-create)

```js
post('Encounter', {
@@ -125,7 +125,10 @@ The result will be written to `state.data`.
## Integration Options

1. **[REST APIs](https://satusehat.kemkes.go.id/platform/docs/id/postman-workshop/)**
enable external services like OpenFn to pull data from Satusehat or push data to Satusehat from external apps. This option is suitable for scheduled workflows or those that need to update data in Satusehat with external information.
enable external services like OpenFn to pull data from Satusehat or push data
to Satusehat from external apps. This option is suitable for scheduled
workflows or those that need to update data in Satusehat with external
information.

## How to Extract or Modify Satusehat Data