{
	"info": {
		"_postman_id": "c6fd8a10-638b-4d3c-9530-2258b82663e8",
		"name": "Open DIPS",
		"description": "Welcome to the Open DIPS postman collection! \n\nTo get started, you'll need to get an Access Token. Open The Auth tab and scroll all the way down to Get New Access Token. Clicking this button will open a web browser, and lets you log in with your DIPS Arena credentials.\n\nBefore you can run any request you need to add your Open DIPS Subscription key to the `dips-subscription-key` header. Click `Variables` in the Open DIPS collection, and add your subscription key (found at [open.dips.no/profile](open.dips.no/profile)) as a Current Value of the `dips-subscription-key` variable. \n\nIf you have any questions, please reach out to us at open@dips.no.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Search for patients with Roland as given name",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Status code is 200\", function () {",
							"    pm.response.to.have.status(200);",
							"});",
							"pm.test(\"Found at least one patient\", function () {",
							"    var jsonData = pm.response.json();",
							"    pm.expect(jsonData.total).to.greaterThan(0);",
							"});"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "dips-subscription-key",
						"value": "",
						"type": "text",
						"disabled": true
					},
					{
						"key": "dips-subscription-key",
						"value": "{{dips-subscription-key}}",
						"type": "text"
					}
				],
				"url": {
					"raw": "https://api.dips.no/fhir/patient?given=Roland",
					"protocol": "https",
					"host": [
						"api",
						"dips",
						"no"
					],
					"path": [
						"fhir",
						"patient"
					],
					"query": [
						{
							"key": "given",
							"value": "Roland"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "Search for practitioners with Amalie as given name",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Status code is 200\", function () {",
							"    pm.response.to.have.status(200);",
							"});",
							"pm.test(\"Found at least one practitioner\", function () {",
							"    var jsonData = pm.response.json();",
							"    pm.expect(jsonData.total).to.greaterThan(0);",
							"});"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "dips-subscription-key",
						"value": "",
						"type": "text",
						"disabled": true
					},
					{
						"key": "dips-subscription-key",
						"value": "{{dips-subscription-key}}",
						"type": "text"
					}
				],
				"url": {
					"raw": "https://api.dips.no/fhir/practitioner?given=Amalie",
					"protocol": "https",
					"host": [
						"api",
						"dips",
						"no"
					],
					"path": [
						"fhir",
						"practitioner"
					],
					"query": [
						{
							"key": "given",
							"value": "Amalie"
						}
					]
				}
			},
			"response": []
		}
	],
	"auth": {
		"type": "oauth2",
		"oauth2": [
			{
				"key": "tokenName",
				"value": "open dips ",
				"type": "string"
			},
			{
				"key": "challengeAlgorithm",
				"value": "S256",
				"type": "string"
			},
			{
				"key": "useBrowser",
				"value": true,
				"type": "boolean"
			},
			{
				"key": "scope",
				"value": "openid offline_access dips-fhir",
				"type": "string"
			},
			{
				"key": "grant_type",
				"value": "authorization_code",
				"type": "string"
			},
			{
				"key": "clientSecret",
				"value": "postman",
				"type": "string"
			},
			{
				"key": "clientId",
				"value": "postman",
				"type": "string"
			},
			{
				"key": "authUrl",
				"value": "https://api.dips.no/dips.oauth/connect/authorize",
				"type": "string"
			},
			{
				"key": "addTokenTo",
				"value": "header",
				"type": "string"
			},
			{
				"key": "client_authentication",
				"value": "header",
				"type": "string"
			},
			{
				"key": "accessTokenUrl",
				"value": "https://api.dips.no/dips.oauth/connect/token",
				"type": "string"
			}
		]
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					"subscription_key = pm.variables.get(\"dips-subscription-key\");",
					"if(subscription_key == \"\"){",
					"    console.warn(\"Please set the dips-subscription-key variable in the collection. You'll find your subscription key on open.dips.no/profile\")",
					"}"
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "dips-subscription-key",
			"value": ""
		}
	]
}