{
	"info": {
		"_postman_id": "162b9225-9e67-462f-987b-429b7a957b6c",
		"name": "MPI",
		"description": "Chamar token dev antes de GET patient.\n\nDescrição do id:  \nEsse parâmetro é formado concatenando-se o Object Identifier (oid), o separador '-' e o valor do identificador. São aceitos oids para os seguintes domínios: CPF (2.16.840.1.113883.13.237), CNS (2.16.840.1.113883.13.236), Passaporte (2.16.840.1.113883.4.330), Registro Nacional de Estrageiros - RNE (1.3.6.1.4.1.54443.1.1.3.3), QSaúde (1.3.6.1.4.1.54443.1.1.3.1) e SAMI (1.3.6.1.4.1.54443.1.1.3.4). Por exemplo, o id: 2.16.840.1.113883.13.237-12345678900 representa o paciente cujo CPF é 12345678900;\n\no id: 2.16.840.1.113883.13.236-123456789123456 representa o paciente cujo CNS é 123456789123456.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "29352440"
	},
	"item": [
		{
			"name": "token dev",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"pm.test(\"Status code is 200\", function () {\r",
							"    pm.response.to.have.status(200);\r",
							"});\r",
							"\r",
							"pm.test(\"Has access token\", function () {\r",
							"    var jsonData = pm.response.json();\r",
							"    pm.expect(jsonData).to.have.property('access_token');\r",
							"    pm.expect(jsonData.access_token).not.eq(undefined);\r",
							"    \r",
							"    // salva token\r",
							"    pm.globals.set(\"access_token\", jsonData.access_token);\r",
							"});"
						],
						"type": "text/javascript"
					}
				}
			],
			"protocolProfileBehavior": {
				"disabledSystemHeaders": {}
			},
			"request": {
				"auth": {
					"type": "basic",
					"basic": [
						{
							"key": "password",
							"value": "{{consumerSecretDev}}",
							"type": "string"
						},
						{
							"key": "username",
							"value": "{{consumerKeyDev}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "urlencoded",
					"urlencoded": [
						{
							"key": "grant_type",
							"value": "client_credentials",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{endpoint}}/token",
					"host": [
						"{{endpoint}}"
					],
					"path": [
						"token"
					]
				}
			},
			"response": []
		},
		{
			"name": "GET Patient",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/fhir+json",
						"type": "text"
					},
					{
						"key": "Accept",
						"value": "application/fhir+json",
						"type": "text"
					}
				],
				"url": {
					"raw": "{{endpoint}}/mpi/fhir/1.0.1/Patient/{{patientOidCPF}}-{{patientIdentifier}}",
					"host": [
						"{{endpoint}}"
					],
					"path": [
						"mpi",
						"fhir",
						"1.0.1",
						"Patient",
						"{{patientOidCPF}}-{{patientIdentifier}}"
					]
				}
			},
			"response": []
		}
	],
	"auth": {
		"type": "bearer",
		"bearer": [
			{
				"key": "token",
				"value": "{{access_token}}",
				"type": "string"
			}
		]
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "endpoint",
			"value": "https://dev.ipes.tech",
			"type": "string"
		},
		{
			"key": "consumerKeyDev",
			"value": "",
			"type": "string"
		},
		{
			"key": "consumerSecretDev",
			"value": "",
			"type": "string"
		},
		{
			"key": "patientOidCNS",
			"value": "2.16.840.1.113883.13.236",
			"type": "string"
		},
		{
			"key": "patientOidCPF",
			"value": "2.16.840.1.113883.13.237",
			"type": "string"
		},
		{
			"key": "patientIdentifier",
			"value": "13245678910",
			"type": "string"
		}
	]
}