{ "info": { "_postman_id": "258c7a12-6811-423d-a6f2-932eac9498a5", "name": "OLMIS-5415", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Get user token", "event": [ { "listen": "test", "script": { "id": "41d2b8e7-624b-44e1-affc-0cb1f81041e3", "type": "text/javascript", "exec": [ "postman.setEnvironmentVariable(\"USER_TOKEN\", JSON.parse(responseBody).access_token);" ] } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "user-client", "type": "string" }, { "key": "password", "value": "changeme", "type": "string" } ] }, "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "username", "value": "admin", "type": "text" }, { "key": "password", "value": "password", "type": "text" } ] }, "url": { "raw": "https://{{ADDRESS}}/api/oauth/token?grant_type=password", "protocol": "https", "host": [ "{{ADDRESS}}" ], "path": [ "api", "oauth", "token" ], "query": [ { "key": "grant_type", "value": "password" } ] } }, "response": [] }, { "name": "Get service-level token", "event": [ { "listen": "test", "script": { "id": "00c3ef33-eb57-4a96-8a30-865ce22af1c6", "type": "text/javascript", "exec": [ "postman.setEnvironmentVariable(\"SERVICE_TOKEN\", JSON.parse(responseBody).access_token);" ] } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "password", "value": "secret", "type": "string" }, { "key": "username", "value": "trusted-client", "type": "string" } ] }, "method": "POST", "header": [], "body": {}, "url": { "raw": "https://{{ADDRESS}}/api/oauth/token?grant_type=client_credentials", "protocol": "https", "host": [ "{{ADDRESS}}" ], "path": [ "api", "oauth", "token" ], "query": [ { "key": "grant_type", "value": "client_credentials" } ] } }, "response": [] }, { "name": "Add facility", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{USER_TOKEN}}" } ], "body": { "mode": "raw", "raw": "{\n\t\"code\": \"CT-F\",\n\t\"name\": \"Contract Test Facility\",\n\t\"description\": \"This is an example facility which should be added to FHIR server\",\n\t\"active\": true,\n\t\"goLiveDate\": \"2015-01-01\",\n\t\"goDownDate\": \"2020-12-31\",\n\t\"comment\": \"Example comment\",\n\t\"enabled\": true,\n\t\"openLmisAccessible\": true,\n\t\"supportedPrograms\": [{\n\t\t\"id\": \"dce17f2e-af3e-40ad-8e00-3496adef44c3\",\n\t\t\"code\": \"PRG001\",\n\t\t\"name\": \"Family Planning\",\n\t\t\"programActive\": true,\n\t\t\"periodsSkippable\": true,\n\t\t\"showNonFullSupplyTab\": true,\n\t\t\"supportActive\": true,\n\t\t\"supportLocallyFulfilled\": false,\n\t\t\"supportStartDate\": \"2015-01-01\"\n\t}],\n\t\"geographicZone\": {\n\t\t\"id\": \"4df0cc89-8a71-450f-9c1a-29ceea1f14f3\"\n\t},\n\t\"operator\": {\n\t\t\"id\": \"9456c3e9-c4a6-4a28-9e08-47ceb16a4121\"\n\t},\n\t\"type\": {\n\t\t\"id\": \"ac1d268b-ce10-455f-bf87-9c667da8f060\"\n\t},\n\t\"extraData\": { }\n}" }, "url": { "raw": "https://{{ADDRESS}}/api/facilities", "protocol": "https", "host": [ "{{ADDRESS}}" ], "path": [ "api", "facilities" ] } }, "response": [] }, { "name": "Add geo zone", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{USER_TOKEN}}" } ], "body": { "mode": "raw", "raw": "{\n\t\"code\" : \"CT-GZ\",\n\t\"name\" : \"Contract Test Geographic Zone\",\n\t\"level\" : {\n\t\t\"id\" : \"90e35999-a64f-4312-ba8f-bc13a1311c75\"\n\t},\n\t\"catchmentPopulation\" : 1000,\n\t\"latitude\" : 0,\n\t\"longitude\" : 0,\n\t\"parent\" : {\n\t\t\"id\" : \"4e471242-da63-436c-8157-ade3e615c848\"\n\t},\n\t\"extraData\" : { }\n}" }, "url": { "raw": "https://{{ADDRESS}}/api/geographicZones", "protocol": "https", "host": [ "{{ADDRESS}}" ], "path": [ "api", "geographicZones" ] } }, "response": [] }, { "name": "Add location - facility", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{API_KEY}}" } ], "body": { "mode": "raw", "raw": "{\n\t\"resourceType\": \"Location\",\n\t\"name\": \"Contract Test FHIR Facility\",\n\t\"description\": \"This is an example location which should be added to the reference data service\",\n\t\"alias\": [\"CT-FHIR-F\"],\n\t\"partOf\": {\n\t\t\"reference\": \"http://nginx/api/Location/4df0cc89-8a71-450f-9c1a-29ceea1f14f3\"\n\t},\n\t\"physicalType\": {\n\t\t\"coding\": [{\n\t\t\t\"code\": \"si\"\n\t\t}]\n\t},\n\t\"status\": \"inactive\"\n}" }, "url": { "raw": "https://{{ADDRESS}}/hapifhir/Location", "protocol": "https", "host": [ "{{ADDRESS}}" ], "path": [ "hapifhir", "Location" ] } }, "response": [] }, { "name": "add location - geo zone", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{API_KEY}}" } ], "body": { "mode": "raw", "raw": "{\n\t\"resourceType\": \"Location\",\n\t\"name\": \"Contract Test FHIR Geographic Zone 1\",\n\t\"alias\": [\"CT-FHIR-GZ-1\"],\n\t\"position\": {\n\t\t\"latitude\": 0,\n\t\t\"longitude\": 0\n\t},\n\t\"physicalType\": {\n\t\t\"coding\": [{\n\t\t\t\"code\": \"area\"\n\t\t}]\n\t}\n}" }, "url": { "raw": "https://{{ADDRESS}}/hapifhir/Location", "protocol": "https", "host": [ "{{ADDRESS}}" ], "path": [ "hapifhir", "Location" ] } }, "response": [] }, { "name": "add location - geo zone with parent", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Authorization", "value": "Bearer {{API_KEY}}" } ], "body": { "mode": "raw", "raw": "{\n\t\"resourceType\": \"Location\",\n\t\"name\": \"Contract Test FHIR Geographic Zone 2\",\n\t\"alias\": [\"CT-FHIR-GZ-2\"],\n\t\"partOf\": {\n\t\t\"reference\": \"http://nginx/api/Location/4e471242-da63-436c-8157-ade3e615c848\"\n\t},\n\t\"position\": {\n\t\t\"latitude\": 0,\n\t\t\"longitude\": 0\n\t},\n\t\"physicalType\": {\n\t\t\"coding\": [{\n\t\t\t\"code\": \"area\"\n\t\t}]\n\t}\n}" }, "url": { "raw": "https://{{ADDRESS}}/hapifhir/Location", "protocol": "https", "host": [ "{{ADDRESS}}" ], "path": [ "hapifhir", "Location" ] } }, "response": [] }, { "name": "Get fhir location", "request": { "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json", "disabled": true }, { "key": "Authorization", "value": "Bearer {{SERVICE_TOKEN}}" } ], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "https://{{ADDRESS}}/hapifhir/Location/", "protocol": "https", "host": [ "{{ADDRESS}}" ], "path": [ "hapifhir", "Location", "" ] } }, "response": [] } ], "event": [ { "listen": "prerequest", "script": { "id": "5d71e334-c139-4b7f-ace1-4a480fe5af85", "type": "text/javascript", "exec": [ "" ] } }, { "listen": "test", "script": { "id": "13fe9b1c-38ae-4326-afdc-fb96febb7bb1", "type": "text/javascript", "exec": [ "" ] } } ], "variable": [ { "id": "17f3e758-ccc5-4d85-8035-bce3d78a0fa9", "key": "ADDRESS", "value": "uat.openlmis.org", "type": "string" }, { "id": "6deed85f-6e26-44e1-ae52-6f950df77947", "key": "API_KEY", "value": "9a556033-ed13-4dde-9561-158469d15134", "type": "string" } ] }