{"info":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","description":"<html><head></head><body><h2 id=\"authorization\">Authorization</h2>\n<p>This API uses a combination of OAuth 2.0 with the Client Credentials Grant and <code>X-AMDI-</code> http headers in each request for authorization. You must obtain an access token from the authorization server before making API requests.</p>\n<h3 id=\"x-amdi--headers\">X-AMDI-* Headers</h3>\n<p>These headers need to included in ALL requests, else the cloud will return an Bad Request error everytime.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Header</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>X-AMDI-ORG-ID</td>\n<td>Organization ID.  <br>  <br>This can be obtained uing the <strong>Devices/Health Check</strong> service. This service will provide the Organization ID associated with the device.</td>\n</tr>\n<tr>\n<td>X-AMDI-SITE-ID</td>\n<td>Site ID.  <br>  <br>This can be obtained uing the <strong>Devices/Health Check</strong> service. This service will provide the Site ID associated with the device.</td>\n</tr>\n<tr>\n<td>X-AMDI-LOCATION-ID</td>\n<td>Location ID.  <br>  <br>This can be obtained uing the <strong>Devices/Health Check</strong> service. This service will provide the Location ID associated with the device.</td>\n</tr>\n<tr>\n<td>X-AMDI-OPERATOR-ID</td>\n<td>Operator ID.  <br>  <br>This can be obtained uing the <strong>Authorization &amp; Authentication/Username + Password</strong> service. This service will provide the Operator ID.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"obtain-access-token\">Obtain Access Token</h3>\n<p>To obtain an access token, make a POST request to the token endpoint:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /token\nHost: authorization-server.com\nContent-Type: application/x-www-form-urlencoded\n\n</code></pre><p><strong>Request Parameters:</strong></p>\n<ul>\n<li><p><code>grant_type</code>: The type of grant being used. For client credentials, use <code>client_credentials</code>.</p>\n</li>\n<li><p><code>client_id</code>: The client ID obtained from the authorization server.</p>\n</li>\n<li><p><code>client_secret</code>: The client secret obtained from the authorization server.</p>\n</li>\n</ul>\n<p><strong>Example Request:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /token HTTP/1.1\nHost: authorization-server.com\nContent-Type: application/x-www-form-urlencoded\ngrant_type=client_credentials&amp;client_id=YOUR_CLIENT_ID&amp;client_secret=YOUR_CLIENT_SECRET\n\n</code></pre><p>Sure! Below is an example of how you might document an API that uses the OAuth 2.0 Client Credentials Grant for authentication.</p>\n<p><strong>Example Response:</strong></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>{\n  \"access_token\": \"your_access_token\",\n  \"token_type\": \"bearer\",\n  \"expires_in\": 28800\n}\n\n</code></pre><h3 id=\"using-the-access-token\">Using the Access Token</h3>\n<p>Once you have obtained an access token, include it in the <code>Authorization</code> header of your API requests:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Authorization: Bearer your_access_token\n\n</code></pre></body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"17812558","collectionId":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","publishedId":"2sB3dSQUQA","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-12-11T17:25:49.000Z"},"item":[{"name":"Authorization and Authentication","item":[{"name":"Authenticate User","event":[{"listen":"test","script":{"id":"294be360-9d41-4402-a748-3e508f7a22ba","exec":["responseData = null;","if (pm.collectionVariables.get('bearer_token')){","    responseData = pm.response.json();","","    if(responseData.error && responseData.error.code && responseData.error.code == \"20400\"){","        pm.collectionVariables.set('operator_id', responseData.error.details.operator_id);","    }else if(pm.response.staus == 200){","        pm.collectionVariables.set('operator_id', responseData.response.operator_id);","    }","","    pm.test(`${pm.info.requestName} response status code is successful`, function () {","        if(responseData.error && responseData.error.code && responseData.error.code == \"20400\"){","            pm.response.to.have.status(400);","        }else{","            pm.response.to.have.status(200);","        }","    });","","    pm.test(`${pm.info.requestName} has a valid response schema`, function () {","        pm.expect(responseData).to.be.an('object');","","        if(responseData.error && responseData.error.code && responseData.error.code == \"20400\"){","            // Assert when expected response for user to change their password is returned","            pm.expect(responseData.error).to.be.an('object');","            pm.expect(responseData.error.details).to.be.an('object');","","            pm.expect(responseData.error.code).to.exist.and.to.be.a('string');","            pm.expect(responseData.error.message).to.exist.and.to.be.a('string');","            pm.expect(responseData.error.details.operator_id).to.exist.and.to.be.a('number');","        }","        else{","            pm.expect(responseData.response.operator_id).to.exist.and.to.be.a('number');","            pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","            pm.expect(responseData.response.username).to.exist.and.to.be.a('string');","            pm.expect(responseData.response.first_name).to.exist.and.to.be.a('string');","            pm.expect(responseData.response.last_name).to.exist.and.to.be.a('string');","            pm.expect(responseData.response.operator_type).to.exist.and.to.be.a('string');","            pm.expect(responseData.response.operator_type_id).to.exist.and.to.be.a('number');","            pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","","            pm.expect(responseData.response).to.have.property('badge_number');","            if(responseData.response.badge_number) pm.expect(responseData.response.badge_number).to.exist.and.to.be.a('string');","","            pm.expect(responseData.response).to.have.property('email');","            if(responseData.response.email) pm.expect(responseData.response.email).to.exist.and.to.be.a('string');","            ","            pm.expect(responseData.response).to.have.property('comments');","            if(responseData.response.comments) pm.expect(responseData.response.comments).to.exist.and.to.be.a('string');","        }","    });","}else{","    pm.test(`${pm.info.requestName} response status code is unauthorized`, function () {","        pm.response.to.have.status(401);","    });","","    pm.test(\"Response content type is not JSON\", function () {","        pm.expect(pm.response.headers.get(\"Content-Type\").includes(\"application/json\")).to.be.false;","    });","}","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    if (pm.collectionVariables.get('bearer_token')){","        if(responseData.error && responseData.error.code && responseData.error.code == \"20400\"){","            pm.execution.setNextRequest(\"Change Operator Password\")","        }else{","            if (!pm.collectionVariables.get('new_operator_username')){","                pm.execution.setNextRequest(\"Search Operator by Badge Number\");","            }else{","                pm.execution.setNextRequest(\"Start Account Recovery\");","            }","        }","    } else {","        pm.execution.setNextRequest(\"Get Authorization Token\");","    }","}"],"type":"text/javascript","packages":{},"requests":{}}},{"listen":"prerequest","script":{"id":"f68d5167-3e81-4984-a699-fee66ae56808","exec":["if (pm.collectionVariables.get('unit_testing') == 'true'){","    if (pm.collectionVariables.get('new_operator_username')){","        pm.collectionVariables.set('operator_username', pm.collectionVariables.get('new_operator_username'));","    }","}"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"8c6ed992-3b68-4e69-950e-3bf28816e012","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"X-AMDI-BASE-SN","value":"","description":"<p>Base S/N</p>\n","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"username\":\"\",\n    \"password\":\"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/identity/auth","description":"<p>Authenticates an Operator user by passing their username and password.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>username</td>\n<td>string</td>\n<td>Operator username</td>\n</tr>\n<tr>\n<td>password</td>\n<td>string</td>\n<td>Operator password encoded in base64</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["v1","identity","auth"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[{"id":"b5be2631-5b50-4452-a148-50eda23b2fd5","name":"Username + Password Auth","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"username\":\"<string>\",\n    \"password\":\"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"<API Base URL>/v1/identity/auth"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":""}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"operator_id\": 1000001,\n        \"org_id\": 1000001,\n        \"badge_number\": \"OPERATORTEST0000001\",\n        \"user_id\": 1000001,\n        \"username\": \"SIMON@VISCOSITYNA.COM\",\n        \"email\": \"simon@viscosityna.com\",\n        \"first_name\": \"Simon\",\n        \"last_name\": \"Bolivar\",\n        \"operator_type\": \"operator\",\n        \"comments\": \"This is a test\",\n        \"active\": true\n    }\n}"}],"_postman_id":"8c6ed992-3b68-4e69-950e-3bf28816e012"},{"name":"Get Authorization Token","event":[{"listen":"prerequest","script":{"id":"b765b168-3537-46e7-ad9b-dd5d0ed77625","exec":[""],"type":"text/javascript","packages":{},"requests":{}}},{"listen":"test","script":{"id":"384eb563-0e7a-4c20-b364-b7e637198d71","exec":["","const responseData = pm.response.json();","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} response has a valid access token`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.access_token).to.exist;","    pm.expect(responseData.token_type).to.exist;","    pm.expect(responseData.expires_in).to.exist;","});","","pm.collectionVariables.set('bearer_token', responseData.access_token);","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    if (!pm.collectionVariables.get('new_operator_username')){","        pm.execution.setNextRequest(\"Setup Unit Testing\");","    }else{","        pm.execution.setNextRequest('Authenticate User');","    }","}"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"0ea85e1d-341e-4491-9b10-5fad044d8440","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"{{api_client_id}}"},{"key":"password","value":"{{api_client_secret}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"client_credentials","type":"text"}]},"url":"{{base_url}}/oauth/token","urlObject":{"path":["oauth","token"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[{"id":"2ee4214e-74f1-48b2-86a2-7e8f4e66dd12","name":"Get Authorization Token","originalRequest":{"method":"POST","header":[],"body":{"mode":"urlencoded","urlencoded":[{"key":"grant_type","value":"client_credentials","type":"text"}]},"url":"<API Base URL>/oauth/token"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"access_token\": \"RM-tybGbG2c9mSVmlQGalQ\",\n    \"token_type\": \"bearer\",\n    \"expires_in\": 28800\n}"}],"_postman_id":"0ea85e1d-341e-4491-9b10-5fad044d8440"},{"name":"Change Operator Password","event":[{"listen":"prerequest","script":{"exec":["pm.collectionVariables.set('operator_current_password',pm.collectionVariables.get('operator_password'));","pm.collectionVariables.set('operator_new_password',pm.collectionVariables.get('operator_password'));"],"type":"text/javascript","packages":{},"id":"c34c20fb-8ee4-4a63-9b80-dfec2bbf006d"}},{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.status).to.exist.and.to.be.a('string');","});","","if(pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest('Authenticate User');","}",""],"type":"text/javascript","packages":{},"id":"55b161b4-2b6c-47ab-a177-c320356b5f11"}}],"id":"48701087-eaf0-46ad-bc43-f8e46059c260","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{   \n    \"current_password\": \"\",\n    \"new_password\": \"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/identity/changepassword","description":"<p>Changes an Operator password by providing the current password and the new password.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>current_password</td>\n<td>string</td>\n<td>Current Operator password encoded in base64</td>\n</tr>\n<tr>\n<td>new_password</td>\n<td>string</td>\n<td>New Operator password encoded in base64</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["v1","identity","changepassword"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"48701087-eaf0-46ad-bc43-f8e46059c260"},{"name":"Start Account Recovery","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.status).to.be.eq('success');","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(null);","}"],"type":"text/javascript","packages":{},"id":"dc9f9cae-924a-4daf-954d-e7d53347cd8d"}}],"id":"c4c5c179-9651-4b03-8bfa-325835e9a080","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"X-AMDI-BASE-SN","value":"","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"username\": \"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/identity/accountrecovery","urlObject":{"path":["v1","identity","accountrecovery"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"c4c5c179-9651-4b03-8bfa-325835e9a080"},{"name":"Check Username","event":[{"listen":"prerequest","script":{"exec":["if (!pm.collectionVariables.get('new_operator_username')){","    pm.collectionVariables.set('check_operator_username', 'TEST_' + pm.collectionVariables.get('operator_username'));","}else{","    pm.collectionVariables.set('check_operator_username', pm.collectionVariables.get('new_operator_username'));","}"],"type":"text/javascript","packages":{},"id":"32b056e6-22d7-4a88-bda0-e5ac121d0fb0"}},{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","if (!pm.collectionVariables.get('new_operator_username')){","    pm.test(`${pm.info.requestName} response status code is successful`, function () {","        pm.response.to.have.status(200);","    });","","    pm.test(`${pm.info.requestName} has a valid response schema`, function () {","        pm.expect(responseData).to.be.an('object');","        pm.expect(responseData.status).to.be.eq('success');","    });","} else {","    pm.test(`${pm.info.requestName} response status code is 400`, function () {","        pm.response.to.have.status(400);","    });","","    pm.test(`${pm.info.requestName} has a valid error code`, function () {","        pm.expect(responseData).to.be.an('object');","        pm.expect(responseData.error.code).to.be.eq('20334');","    });","}","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    if (!pm.collectionVariables.get('new_operator_username')){","        pm.execution.setNextRequest('Check Password');","    }else{","        pm.execution.setNextRequest('Update Operator');","    }","}"],"type":"text/javascript","packages":{},"id":"72b03a48-c843-4c91-9b4b-63080188bd60"}}],"id":"f05c39a7-40a5-493e-8dce-7675a3e2f640","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"username\": \"\",\n    \"operator_type_id\": \"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/identity/checkusername","description":"<p>Checks that a username value passes the system's username policies.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>username</td>\n<td>string</td>\n<td>Username</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["v1","identity","checkusername"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f05c39a7-40a5-493e-8dce-7675a3e2f640"},{"name":"Check Password","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","if (!pm.collectionVariables.get('correct_operator_password')) {","    pm.test(`${pm.info.requestName} response status code is successful`, function () {","        pm.response.to.have.status(200);","    });","","    pm.test(`${pm.info.requestName} has a valid response schema`, function () {","        pm.expect(responseData).to.be.an('object');","        pm.expect(responseData.status).to.be.eq('success');","    });","} else {","    pm.test(`${pm.info.requestName} response status code is 400`, function () {","        pm.response.to.have.status(400);","    });","","    pm.test(`${pm.info.requestName} has a valid error code`, function () {","        pm.expect(responseData).to.be.an('object');","        pm.expect(responseData.error.code).to.be.eq('20338');","    });","}","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    if (!pm.collectionVariables.get('correct_operator_password')) {","        pm.execution.setNextRequest(\"New Operator\");","    } else {","        pm.execution.setNextRequest(\"Check Password\");","    }","}"],"type":"text/javascript","packages":{},"id":"1db96fc2-d222-428a-9c6a-c8dd8edcddc6"}},{"listen":"prerequest","script":{"exec":["if (!pm.collectionVariables.get('correct_operator_password')) {","    pm.collectionVariables.set('correct_operator_password', pm.collectionVariables.get('operator_password'));","    pm.collectionVariables.set('operator_password', '123');","} else {","    pm.collectionVariables.set('operator_password', pm.collectionVariables.get('correct_operator_password'));","    pm.collectionVariables.unset(\"correct_operator_password\");","}"],"type":"text/javascript","packages":{},"id":"ef147ed9-3f00-4119-acb0-4789be4ba73d"}}],"id":"69f38c26-bd60-495c-993b-2b28797068ca","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"password\": \"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/identity/checkpassword","description":"<p>Checks that a password value passes the system's complexity policies.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>password</td>\n<td>string</td>\n<td>Password encoded in base64</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["v1","identity","checkpassword"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"69f38c26-bd60-495c-993b-2b28797068ca"}],"id":"6fbb33c9-7c14-4acf-9026-e2d337fb2493","description":"<p>Handles user authentication and manages authentication tokens for secure access to the API.</p>\n","_postman_id":"6fbb33c9-7c14-4acf-9026-e2d337fb2493","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}}},{"name":"Operators","item":[{"name":"Operator Types","item":[{"name":"List & Search Operator Types","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","","    pm.expect(responseData.count).to.exist.and.to.be.a('number');","    pm.expect(responseData.count).to.eql(2);","    pm.expect(responseData.items).to.be.an(\"array\").with.lengthOf(2);;","});","","pm.collectionVariables.set('new_operator_type_id', responseData.items.filter(item => item.operator_type === 'administrator')[0].operator_type_id)","pm.collectionVariables.set('operator_type_id', responseData.items.filter(item => item.operator_type === 'operator')[0].operator_type_id)","pm.collectionVariables.set('admin_type_id', responseData.items.filter(item => item.operator_type === 'administrator')[0].operator_type_id)","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest('Check Username');","}"],"type":"text/javascript","packages":{},"id":"d9c3a7dc-eb2e-4961-9ba9-d89a8e0897b6"}}],"id":"85d01a19-c39e-436e-911f-09d49c8c34bf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/v1/operatortypes/","description":"<p>Retrieves detailed information about a specific operator identified by their unique identifier.</p>\n","urlObject":{"path":["v1","operatortypes",""],"host":["{{base_url}}"],"query":[{"disabled":true,"description":{"content":"<p>Operator Type ID</p>\n","type":"text/plain"},"key":"operator_type_id","value":"<string>"},{"disabled":true,"description":{"content":"<p>Operator Type (LOV: administrator, operator)</p>\n","type":"text/plain"},"key":"operator_type","value":"<string>"}],"variable":[]}},"response":[{"id":"11e13493-4ff6-4015-a7db-5ae6a4c4c179","name":"List & Search Operator Types","originalRequest":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Organization's Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID"}],"url":{"raw":"<API Base URL>/v1/operatortypes/","host":["<API Base URL>"],"path":["v1","operatortypes",""],"query":[{"key":"operator_type_id","value":"<string>","description":"Operator Type ID","disabled":true},{"key":"operator_type","value":"<string>","description":"Operator Type (LOV: administrator, operator)","disabled":true}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"items\": [\n        {\n            \"operator_type_id\": 1000001,\n            \"operator_type\": \"operator\",\n            \"links\": [\n                {\n                    \"rel\": \"uri\",\n                    \"href\": \"https://xjxwwoy8onmxccz-amdideviad.adb.us-ashburn-1.oraclecloudapps.com/ords/amdi/v1/operatortypes/1\"\n                }\n            ]\n        }\n    ],\n    \"hasMore\": false,\n    \"limit\": 25,\n    \"offset\": 0,\n    \"count\": 1,\n    \"links\": [\n        {\n            \"rel\": \"self\",\n            \"href\": \"https://xjxwwoy8onmxccz-amdideviad.adb.us-ashburn-1.oraclecloudapps.com/ords/amdi/v1/operatortypes/\"\n        },\n        {\n            \"rel\": \"describedby\",\n            \"href\": \"https://xjxwwoy8onmxccz-amdideviad.adb.us-ashburn-1.oraclecloudapps.com/ords/amdi/metadata-catalog/v1/operatortypes/\"\n        },\n        {\n            \"rel\": \"first\",\n            \"href\": \"https://xjxwwoy8onmxccz-amdideviad.adb.us-ashburn-1.oraclecloudapps.com/ords/amdi/v1/operatortypes/\"\n        }\n    ]\n}"}],"_postman_id":"85d01a19-c39e-436e-911f-09d49c8c34bf"}],"id":"06fc31b0-fc6e-4b5e-9c89-32a2a911276b","_postman_id":"06fc31b0-fc6e-4b5e-9c89-32a2a911276b","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}}},{"name":"New Operator","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","if (pm.collectionVariables.get('new_operator_type_id') == pm.collectionVariables.get('admin_type_id')){","    pm.test(`${pm.info.requestName} response status code is error`, function () {","        pm.response.to.have.status(400);","    });","","    pm.test(`${pm.info.requestName} has a valid error code username already in use`, function () {","        pm.expect(responseData).to.be.an('object');","        pm.expect(responseData.error).to.be.an('object');","        pm.expect(responseData.error.code).to.be.eq('20029');","        pm.expect(responseData.error.code).to.exist.and.to.be.a('string');","        pm.expect(responseData.error.message).to.exist.and.to.be.a('string');","    });","} else if (pm.collectionVariables.get('new_operator_username') == pm.collectionVariables.get('operator_username')){","    pm.test(`${pm.info.requestName} response status code is error`, function () {","        pm.response.to.have.status(400);","    });","","    pm.test(`${pm.info.requestName} has a valid error code username invalid format`, function () {","        pm.expect(responseData).to.be.an('object');","        pm.expect(responseData.error).to.be.an('object');","        pm.expect(responseData.error.code).to.be.eq('20028');","        pm.expect(responseData.error.code).to.exist.and.to.be.a('string');","        pm.expect(responseData.error.message).to.exist.and.to.be.a('string');","    });","} else {","    pm.test(`${pm.info.requestName} response status code is successful`, function () {","        pm.response.to.have.status(200);","    });","","    pm.test(`${pm.info.requestName} has a valid response schema`, function () {","        pm.expect(responseData).to.be.an('object');","","        pm.expect(responseData.response.operator_id).to.exist.and.to.be.a('number');","        pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","        pm.expect(responseData.response.username).to.exist.and.to.be.a('string');","        pm.expect(responseData.response.badge_number).to.be.a('string');","        pm.expect(responseData.response.first_name).to.exist.and.to.be.a('string');","        pm.expect(responseData.response.last_name).to.exist.and.to.be.a('string');","        pm.expect(responseData.response.email).to.be.a('string');","        pm.expect(responseData.response.operator_type).to.exist.and.to.be.a('string');","        pm.expect(responseData.response.operator_type_id).to.exist.and.to.be.a('number');","        pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","    });","}","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    if (pm.collectionVariables.get('new_operator_username') == pm.collectionVariables.get('operator_username')) {","        pm.execution.setNextRequest('New Operator');","    } else {","        pm.execution.setNextRequest('Check Username');","    }","}"],"type":"text/javascript","packages":{},"id":"bd21f9e0-4851-4560-b0cd-e82c1a56a564"}},{"listen":"prerequest","script":{"exec":["pm.collectionVariables.set('new_operator_badge_number', pm.collectionVariables.get('operator_username') + '_op');","pm.collectionVariables.set('new_operator_email', 'test@mail.com');","pm.collectionVariables.set('new_operator_first_name', 'Operator');","pm.collectionVariables.set('new_operator_last_name', 'User');","pm.collectionVariables.set('new_operator_temp_pass', pm.collectionVariables.get('operator_password'));","","if (!pm.collectionVariables.get('new_operator_username')){","    pm.collectionVariables.set('new_operator_username', pm.collectionVariables.get('operator_username'));","}else if (pm.collectionVariables.get('new_operator_type_id') == pm.collectionVariables.get('admin_type_id')){","    pm.collectionVariables.set('new_operator_type_id', pm.collectionVariables.get('operator_type_id'));","}else{","    pm.collectionVariables.set('new_operator_username', 'TEST_' + pm.collectionVariables.get('org_id') + '_op');","}"],"type":"text/javascript","packages":{},"id":"dfcdf535-3fbb-495c-ae52-f6a48b0e5341"}}],"id":"4e3a7289-01a0-4916-8d96-d2a59ff0e851","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"username\": \"\",\n    \"badge_number\": \"\",\n    \"first_name\": \"\",\n    \"last_name\": \"\",\n    \"email\":\"\",\n    \"password\":\"\",\n    \"operator_type_id\": \"\",\n    \"effective_start_dt\": \"{{new_operator_start_dt}}\",\n    \"effective_end_dt\": \"{{new_operator_end_dt}}\",\n    \"comments\":\"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/operators/","description":"<p>Creates a new operator. If a temporary password is not provided the system will automatically assign a password.</p>\n","urlObject":{"path":["v1","operators",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[{"id":"73abe19a-3e25-443b-8da7-e93910a15712","name":"New Operator","originalRequest":{"method":"POST","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Organization's Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"User ID"}],"body":{"mode":"raw","raw":"{\n    \"badge_number\": \"<string>\",\n    \"first_name\": \"<string>\",\n    \"last_name\": \"<string>\",\n    \"temp_password\":\"<string>\",\n    \"operator_type_id\": \"<integer>\",\n    \"effective_start_dt\": \"<string>\",\n    \"effective_end_dt\": \"<string>\",\n    \"comments\":\"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"<API Base URL>/v1/operators/"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"operator_id\": 1000001,\n        \"org_id\": 1000001,\n        \"badge_number\": \"OPERATORTEST1000001\",\n        \"user_id\": 5,\n        \"username\": \"SIMON@VISCOSITYNA.COM\",\n        \"email\": \"simon@viscosityna.com\",\n        \"first_name\": \"Simon\",\n        \"last_name\": \"Bolivar\",\n        \"operator_type\": \"operator\",\n        \"comments\": \"This is a test\",\n        \"active\": true\n    }\n}"}],"_postman_id":"4e3a7289-01a0-4916-8d96-d2a59ff0e851"},{"name":"Get Operator","id":"dee31ffe-5574-4c78-9de8-c948bb43d2a7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url}}/v1/operators/:operator_id","description":"<p>Retrieves detailed information about a specific operator identified by their unique identifier.</p>\n","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}},"urlObject":{"path":["v1","operators",":operator_id"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"8a2401c2-5e73-43d1-b5b0-96b944d0334b","description":{"content":"<p>Operator ID</p>\n","type":"text/plain"},"type":"any","value":"<integer>","key":"operator_id"}]}},"response":[{"id":"b89a3731-5628-44fe-8b2e-6c1b0cd98805","name":"Get Operator","originalRequest":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Organization's Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID"}],"url":{"raw":"<API Base URL>/v1/operators/:operator_id","host":["<API Base URL>"],"path":["v1","operators",":operator_id"],"variable":[{"key":"operator_id","value":"<integer>","description":"Operator ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"operator_id\": 1000001,\n        \"org_id\": 1000001,\n        \"badge_number\": \"OPERATORTEST1000001\",\n        \"user_id\": 5,\n        \"username\": \"SIMON@VISCOSITYNA.COM\",\n        \"email\": \"simon@viscosityna.com\",\n        \"first_name\": \"Simon\",\n        \"last_name\": \"Bolivar\",\n        \"operator_type\": \"operator\",\n        \"comments\": \"This is a test\",\n        \"active\": true\n    }\n}"}],"_postman_id":"dee31ffe-5574-4c78-9de8-c948bb43d2a7"},{"name":"Update Operator","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData.response.operator_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.username).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.first_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.last_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.operator_type).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.operator_type_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","","    pm.expect(responseData.response).to.have.property('badge_number');","    if(responseData.response.badge_number) pm.expect(responseData.response.badge_number).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('email');","    if(responseData.response.email) pm.expect(responseData.response.email).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('comments');","    if(responseData.response.comments) pm.expect(responseData.response.comments).to.exist.and.to.be.a('string');","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest('Get Authorization Token');","}"],"type":"text/javascript","packages":{},"id":"4fc3c6db-f08c-4bd8-890f-3f54a483f448"}}],"id":"ba26b4c1-6ae5-48a0-9dc2-0e291695271a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"badge_number\": \"\",\n    \"first_name\": \"\",\n    \"last_name\": \"\",\n    \"email\": \"\",\n    \"operator_type_id\": ,\n    \"comments\":\"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/operators/:operator_id","description":"<p>Creates a new operator record with the provided information.</p>\n","urlObject":{"path":["v1","operators",":operator_id"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"49dba0d2-e6d8-4b2b-a0a2-8d5c19216486","description":{"content":"<p>Operator ID</p>\n","type":"text/plain"},"type":"any","value":"","key":"operator_id"}]}},"response":[{"id":"a4df4a22-571e-436b-817c-6902a06317a7","name":"Update Operator","originalRequest":{"method":"PUT","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Organization's Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID"}],"body":{"mode":"raw","raw":"{\n    \"badge_number\": \"TEST10001\",\n    \"first_name\": \"John\",\n    \"middle_name\": \"W\",\n    \"last_name\": \"Smith\",\n    \"operator_type_id\": 1,\n    \"is_physician\": false,\n    \"effective_start_dt\": \"2024-06-10\",\n    \"effective_end_dt\": \"2099-06-10\",\n    \"comments\":\"This is a test operator\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"<API Base URL>/v1/operators/:operator_id","host":["<API Base URL>"],"path":["v1","operators",":operator_id"],"variable":[{"key":"operator_id","value":"<integer>","description":"Operator ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"operator_id\": 1000001,\n        \"org_id\": 1000001,\n        \"badge_number\": \"OPERATORTEST1000001\",\n        \"user_id\": 5,\n        \"username\": \"SIMON@VISCOSITYNA.COM\",\n        \"email\": \"simon@viscosityna.com\",\n        \"first_name\": \"Simon\",\n        \"last_name\": \"Bolivar\",\n        \"operator_type\": \"operator\",\n        \"comments\": \"This is a test\",\n        \"active\": true\n    }\n}"}],"_postman_id":"ba26b4c1-6ae5-48a0-9dc2-0e291695271a"},{"name":"Search Operator by Badge Number","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.response).to.be.an('object');","","    pm.expect(responseData.response.operator_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.username).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.first_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.last_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.operator_type).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.operator_type_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","","    pm.expect(responseData.response).to.have.property('badge_number');","    if(responseData.response.badge_number) pm.expect(responseData.response.badge_number).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('email');","    if(responseData.response.email) pm.expect(responseData.response.email).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('comments');","    if(responseData.response.comments) pm.expect(responseData.response.comments).to.exist.and.to.be.a('string');","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Get Device\");","}"],"type":"text/javascript","packages":{},"id":"9751ebf8-82a2-45ce-ae18-4551f2370cdf"}}],"id":"aa78b839-ca9a-4735-bf8b-8b2c6c9bfa82","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/v1/operators/search/badge_number/:badge_number","urlObject":{"path":["v1","operators","search","badge_number",":badge_number"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"271f049b-a211-4491-8a5d-e5c3beb7ee5d","description":{"content":"<p>Operator Badge Number</p>\n","type":"text/plain"},"type":"any","value":"","key":"badge_number"}]}},"response":[{"id":"f3de169e-c908-417f-8c77-71da92d70153","name":"Search Operator by Badge Number","originalRequest":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"","description":"Organization ID","type":"text"},{"key":"X-AMDI-SITE-ID","value":"","description":"Site ID","type":"text"},{"key":"X-AMDI-LOCATION-ID","value":"","description":"Location ID","type":"text"},{"key":"X-AMDI-OPERATOR-ID","value":"","description":"Operator ID","type":"text"}],"url":{"raw":"{{base_url}}/v1/operators/search/badge_number/:badge_number","host":["{{base_url}}"],"path":["v1","operators","search","badge_number",":badge_number"],"variable":[{"key":"badge_number","value":"","description":"Operator Badge Number"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"operator_id\": 1000001,\n        \"org_id\": 1000001,\n        \"badge_number\": \"OPERATORTEST1000001\",\n        \"user_id\": 5,\n        \"username\": \"SIMON@VISCOSITYNA.COM\",\n        \"email\": \"simon@viscosityna.com\",\n        \"first_name\": \"Simon\",\n        \"last_name\": \"Bolivar\",\n        \"operator_type\": \"operator\",\n        \"comments\": \"This is a test\",\n        \"active\": true\n    }\n}"}],"_postman_id":"aa78b839-ca9a-4735-bf8b-8b2c6c9bfa82"},{"name":"List & Search Operators","id":"c4066ec6-bdba-401b-bed2-c220eee74ecd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/v1/operators/","description":"<p>Retrieves a list of operators and allows searching for specific operators based on certain criteria.</p>\n","urlObject":{"path":["v1","operators",""],"host":["{{base_url}}"],"query":[{"disabled":true,"description":{"content":"<p>Operator ID</p>\n","type":"text/plain"},"key":"search_operator_id","value":"<string>"},{"disabled":true,"description":{"content":"<p>Badge Number</p>\n","type":"text/plain"},"key":"badge_number","value":"<string>"},{"disabled":true,"description":{"content":"<p>First Name</p>\n","type":"text/plain"},"key":"fist_name","value":"<string>"},{"disabled":true,"description":{"content":"<p>Last Name</p>\n","type":"text/plain"},"key":"last_name","value":"<string>"},{"disabled":true,"description":{"content":"<p>Operator Type</p>\n","type":"text/plain"},"key":"operator_type","value":"<string>"},{"disabled":true,"description":{"content":"<p>Email</p>\n","type":"text/plain"},"key":"email","value":"<string>"},{"disabled":true,"description":{"content":"<p>User ID</p>\n","type":"text/plain"},"key":"user_id","value":"<string>"},{"disabled":true,"description":{"content":"<p>Username</p>\n","type":"text/plain"},"key":"usename","value":"<string>"}],"variable":[]}},"response":[{"id":"79954d7d-4e7e-40df-b675-a8061ed3d70e","name":"List & Search Operators","originalRequest":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Organization's Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"User ID"}],"url":{"raw":"<API Base URL>/v1/operators/","host":["<API Base URL>"],"path":["v1","operators",""],"query":[{"key":"search_operator_id","value":"<string>","description":"Operator ID","disabled":true},{"key":"badge_number","value":"<string>","description":"Badge Number","disabled":true},{"key":"fist_name","value":"<string>","description":"First Name","disabled":true},{"key":"last_name","value":"<string>","description":"Last Name","disabled":true},{"key":"operator_type","value":"<string>","description":"Operator Type","disabled":true},{"key":"email","value":"<string>","description":"Email","disabled":true},{"key":"user_id","value":"<string>","description":"User ID","disabled":true},{"key":"usename","value":"<string>","description":"Username","disabled":true}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"items\": [\n        {\n            \"operator_id\": 1000001,\n            \"badge_number\": \"OPERATORTEST1000001\",\n            \"user_id\": 1000001,\n            \"username\": \"SIMON@VISCOSITYNA.COM\",\n            \"email\": \"simon@viscosityna.com\",\n            \"first_name\": \"Simon`\",\n            \"last_name\": \"Bolivar\",\n            \"operator_type\": \"operator\",\n            \"active_ind\": \"Y\",\n            \"comments\": \"This is a test\",\n            \"created_by\": \"ORDS_PUBLIC_USER\",\n            \"created_on\": \"2024-06-19T22:04:16.592739Z\",\n            \"links\": [\n                {\n                    \"rel\": \"uri\",\n                    \"href\": \"https://xjxwwoy8onmxccz-amdideviad.adb.us-ashburn-1.oraclecloudapps.com/ords/amdi/v1/operators/1000001\"\n                }\n            ]\n        }\n    ],\n    \"hasMore\": true,\n    \"limit\": 25,\n    \"offset\": 0,\n    \"count\": 25,\n    \"links\": [\n        {\n            \"rel\": \"self\",\n            \"href\": \"https://xjxwwoy8onmxccz-amdideviad.adb.us-ashburn-1.oraclecloudapps.com/ords/amdi/v1/operators/\"\n        },\n        {\n            \"rel\": \"edit\",\n            \"href\": \"https://xjxwwoy8onmxccz-amdideviad.adb.us-ashburn-1.oraclecloudapps.com/ords/amdi/v1/operators/\"\n        },\n        {\n            \"rel\": \"describedby\",\n            \"href\": \"https://xjxwwoy8onmxccz-amdideviad.adb.us-ashburn-1.oraclecloudapps.com/ords/amdi/metadata-catalog/v1/operators/\"\n        },\n        {\n            \"rel\": \"first\",\n            \"href\": \"https://xjxwwoy8onmxccz-amdideviad.adb.us-ashburn-1.oraclecloudapps.com/ords/amdi/v1/operators/\"\n        },\n        {\n            \"rel\": \"next\",\n            \"href\": \"https://xjxwwoy8onmxccz-amdideviad.adb.us-ashburn-1.oraclecloudapps.com/ords/amdi/v1/operators/?offset=25\"\n        }\n    ]\n}"}],"_postman_id":"c4066ec6-bdba-401b-bed2-c220eee74ecd"}],"id":"ff3c4a13-25c6-4fa2-b163-04167a7a79a9","description":"<p>Manages operator records by providing endpoints to list, search, retrieve, and create operator information.</p>\n","_postman_id":"ff3c4a13-25c6-4fa2-b163-04167a7a79a9","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}}},{"name":"Devices","item":[{"name":"Get Device","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","","    pm.expect(responseData.response.device_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.site_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.location_id).to.exist.and.to.be.a('number');","    ","    pm.expect(responseData.response).to.have.property('base_device_id');","    if(responseData.response.base_device_id) pm.expect(responseData.response.base_device_id).to.be.a('number');","    ","    pm.expect(responseData.response.device_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.status).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.device_type_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.model_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.device_version).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.serial_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.software_version).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.effective_date).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.expiration_date).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_positive_disc_id');","    if(responseData.response.control_positive_disc_id) pm.expect(responseData.response.control_positive_disc_id).to.exist.and.to.be.a('number');","    ","    pm.expect(responseData.response).to.have.property('control_positive_result');","    if(responseData.response.control_positive_result) pm.expect(responseData.response.control_positive_result).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_positive_last_run_on');","    if(responseData.response.control_positive_last_run_on) pm.expect(responseData.response.control_positive_last_run_on).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_negative_disc_id');","    if(responseData.response.control_negative_disc_id) pm.expect(responseData.response.control_negative_disc_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('control_negative_result');","    if(responseData.response.control_negative_result) pm.expect(responseData.response.control_negative_result).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_negative_last_run_on');","    if(responseData.response.control_negative_last_run_on) pm.expect(responseData.response.control_negative_last_run_on).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('port_number');","    if(responseData.response.port_number) pm.expect(responseData.response.port_number).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('comments');","    if(responseData.response.comments) pm.expect(responseData.response.comments).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('activated_on');","    if(responseData.response.activated_on) pm.expect(responseData.response.activated_on).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Software Update\");","}"],"type":"text/javascript","packages":{},"id":"0a354a2d-76bb-41b9-b825-61257fb246da"}},{"listen":"prerequest","script":{"exec":["pm.collectionVariables.set('current_device_id', pm.collectionVariables.get('base_device_id'))"],"type":"text/javascript","packages":{},"id":"ce626596-f9be-4ef6-a61e-c604cbe92601"}}],"id":"a6c94f1c-d8dd-46fc-b66e-172e44cafe0a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/v1/devices/:device_id","description":"<p>Retrieves detailed information about a specific instrument identified by its unique identifier.</p>\n","urlObject":{"path":["v1","devices",":device_id"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"295a94f7-4767-4f76-8b89-cde98b5bc121","description":{"content":"<p>Device ID</p>\n","type":"text/plain"},"type":"any","value":"","key":"device_id"}]}},"response":[{"id":"2bfb75be-d4b8-409e-ad31-13913964fe90","name":"Get Device","originalRequest":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID"}],"url":{"raw":"<API Base URL>/v1/devices/:device_id","host":["<API Base URL>"],"path":["v1","devices",":device_id"],"variable":[{"key":"device_id","value":"1000001","description":"Device ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"device_id\": 1000001,\n        \"org_id\": 1000001,\n        \"site_id\": 1000001,\n        \"location_id\": 1000001,\n        \"base_device_id\": 1000001,\n        \"device_name\": \"Device\",\n        \"status\": \"online\",\n        \"device_type_id\": 1000001,\n        \"model_number\": \"alpha\",\n        \"device_version\": \"v1.00.00\",\n        \"serial_number\": \"DEVICETEST1000001\",\n        \"software_version\": \"v1.00.00\",\n        \"control_positive_disc_id\": 1000001,\n        \"control_positive_result\": \"failed\",\n        \"control_positive_last_run_on\": \"2024-01-01T00:00:00.000000Z\",\n        \"control_negative_disc_id\": 1000001,\n        \"control_negative_result\": \"failed\",\n        \"control_negative_last_run_on\": \"2024-01-01T00:00:00.000000Z\",\n        \"active\": true\n    }\n}"}],"_postman_id":"a6c94f1c-d8dd-46fc-b66e-172e44cafe0a"},{"name":"Health Check","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.collectionVariables.set('operating_module_id', responseData.response.device_id);","pm.collectionVariables.set('base_device_id', responseData.response.base_device_id);","pm.collectionVariables.set('org_id', responseData.response.org_id);","pm.collectionVariables.set('site_id', responseData.response.site_id);","pm.collectionVariables.set('location_id', responseData.response.location_id);","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","","    pm.expect(responseData.response.device_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.site_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.location_id).to.exist.and.to.be.a('number');","    ","    pm.expect(responseData.response).to.have.property('base_device_id');","    if(responseData.response.base_device_id) pm.expect(responseData.response.base_device_id).to.be.a('number');","    ","    pm.expect(responseData.response.device_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.status).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.device_type_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.model_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.device_version).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.serial_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.software_version).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.effective_date).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.expiration_date).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_positive_disc_id');","    if(responseData.response.control_positive_disc_id) pm.expect(responseData.response.control_positive_disc_id).to.exist.and.to.be.a('number');","    ","    pm.expect(responseData.response).to.have.property('control_positive_result');","    if(responseData.response.control_positive_result) pm.expect(responseData.response.control_positive_result).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_positive_last_run_on');","    if(responseData.response.control_positive_last_run_on) pm.expect(responseData.response.control_positive_last_run_on).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_negative_disc_id');","    if(responseData.response.control_negative_disc_id) pm.expect(responseData.response.control_negative_disc_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('control_negative_result');","    if(responseData.response.control_negative_result) pm.expect(responseData.response.control_negative_result).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_negative_last_run_on');","    if(responseData.response.control_negative_last_run_on) pm.expect(responseData.response.control_negative_last_run_on).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('port_number');","    if(responseData.response.port_number) pm.expect(responseData.response.port_number).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('comments');","    if(responseData.response.comments) pm.expect(responseData.response.comments).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('activated_on');","    if(responseData.response.activated_on) pm.expect(responseData.response.activated_on).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Authenticate User\");","}","",""],"type":"text/javascript","packages":{},"id":"d2fb1a0e-792f-46ac-948c-47c200110581"}},{"listen":"prerequest","script":{"exec":["const Header = require('postman-collection').Header;","const now = new Date();","const healthcheck_start_date = now.toISOString().slice(0, 19);","","pm.request.removeHeader('X-AMDI-HEALTH-ERROR-CODE');","pm.request.removeHeader('X-AMDI-HEALTH-STATUS-REASON');","pm.request.upsertHeader(new Header({key:'X-AMDI-HEALTH-START-TIMESTAMP', value: healthcheck_start_date}));","pm.request.upsertHeader(new Header({key:'X-AMDI-HEALTH-END-TIMESTAMP', value: healthcheck_start_date}));","pm.request.removeHeader('X-AMDI-HEALTH-FILENAME');","pm.request.removeHeader('X-AMDI-OPERATOR-ID');","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.request.body.file = null;","}"],"type":"text/javascript","packages":{},"id":"335ea1c0-59d1-43d4-803a-b271043d12df"}}],"id":"5dfea5a3-4f87-493d-8cb7-7edfd3e7b90d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"X-AMDI-HEALTH-STATUS","value":"online","description":"<p>Device Status. (LOV: offline, error, idle/online)</p>\n"},{"key":"X-AMDI-MODULE-SERIAL-NUMBER","value":"","description":"<p>Operating Module Serial Number</p>\n","type":"text"},{"key":"X-AMDI-MODULE-PORT-NUMBER","value":"","description":"<p>Port number to which a Module will be connected to a Base</p>\n","type":"text"}],"body":{"mode":"file","file":{"src":""}},"url":"{{base_url}}/v1/devices/health/:base_serial_number","description":"<p>Receives a health check from an instrument to ensure it is functioning properly. Log files can be transmitted.</p>\n","urlObject":{"path":["v1","devices","health",":base_serial_number"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"0a73e16b-b670-44ce-8e94-8d435b00a6db","description":{"content":"<p>Base Device Serial Number</p>\n","type":"text/plain"},"type":"any","value":"","key":"base_serial_number"}]}},"response":[{"id":"d01a3097-7819-4f15-83a6-b0b1b3a61c8e","name":"Health Check","originalRequest":{"method":"POST","header":[{"key":"X-AMDI-HEALTH-STATUS","value":"<string>","description":"Device Status"},{"key":"X-AMDI-HEALTH-STATUS-REASON","value":"<string>","description":"Status Reason"},{"key":"X-AMDI-HEALTH-TIMESTAMP","value":"<string>","description":"Status Timestamp UTC (ISO-8601 format)"},{"key":"X-AMDI-HEALTH-FILENAME","value":"<string>","description":"Status Payload Filename"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID"}],"body":{"mode":"file","file":{}},"url":{"raw":"<API Base URL>/v1/devices/health/:serial_number","host":["<API Base URL>"],"path":["v1","devices","health",":serial_number"],"variable":[{"key":"serial_number","value":"<string>","description":"Device Serial Number"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\"\n}"},{"id":"b9d6bea3-a0cd-4e55-9fdb-4302b6f65a60","name":"Health Check - Base Needs Activation","originalRequest":{"method":"POST","header":[{"key":"X-AMDI-HEALTH-STATUS","value":"<string>","description":"Device Status. (LOV: offline, error, idle/online)","disabled":true},{"key":"X-AMDI-HEALTH-ERROR-CODE","value":"<string>","description":"Device Error Code","type":"text","disabled":true},{"key":"X-AMDI-HEALTH-STATUS-REASON","value":"<string>","description":"Status Reason","disabled":true},{"key":"X-AMDI-HEALTH-START-TIMESTAMP","value":"<string>","description":"Status Start Timestamp UTC (ISO-8601 format)","disabled":true},{"key":"X-AMDI-HEALTH-END-TIMESTAMP","value":"<string>","description":"Status End Timestamp UTC (ISO-8601 format)","type":"text","disabled":true},{"key":"X-AMDI-HEALTH-FILENAME","value":"<string>","description":"Status Payload Filename","disabled":true},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID","disabled":true},{"key":"X-AMDI-MODULE-SERIAL-NUMBER","value":"<string>","description":"Operating Module Serial Number","type":"text","disabled":true}],"body":{"mode":"file","file":{}},"url":{"raw":"{{base_url}}/v1/devices/health/:base_serial_number","host":["{{base_url}}"],"path":["v1","devices","health",":base_serial_number"],"variable":[{"key":"base_serial_number","value":"<string>","description":"Base Serial Number"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": {\n        \"code\": \"BASE_NEEDS_ACTIVATION\",\n        \"message\": \"Base needs activation\",\n        \"details\": \"Base needs activation\"\n    }\n}"}],"_postman_id":"5dfea5a3-4f87-493d-8cb7-7edfd3e7b90d"},{"name":"Start Base Station Activation","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData).to.have.property('status');","    pm.expect(responseData).to.have.property('response');","    pm.expect(responseData.response).to.be.an('object');","    pm.expect(responseData.response).to.have.property('device_id');","    pm.expect(responseData.response).to.have.property('activation_code');","    pm.expect(responseData.response).to.have.property('activation_code_expires_on');","","    pm.collectionVariables.set('base_device_id', responseData.response.device_id);","    pm.collectionVariables.set('base_activation_code', responseData.response.activation_code);","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Activate Base Device\");","}"],"type":"text/javascript","packages":{},"id":"f780faff-e670-4eab-ba8d-8cff2fe4a74e"}},{"listen":"prerequest","script":{"exec":[""],"type":"text/javascript","packages":{},"id":"1692d3f1-9d4c-4650-ad4e-de575aae8a71"}}],"id":"b2162e58-77a3-4c60-80ac-1481283881b2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"url":"{{base_url}}/v1/devices/startactivation/:serial_number","urlObject":{"path":["v1","devices","startactivation",":serial_number"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"05cb7abf-5b3b-46c8-8987-4b8086d027e5","description":{"content":"<p>Base Serial Number</p>\n","type":"text/plain"},"type":"any","value":"","key":"serial_number"}]}},"response":[{"id":"f21e16f6-db90-413b-b57f-696505bec9df","name":"Start Device Activation","originalRequest":{"method":"POST","header":[],"url":{"raw":"{{base_url}}/v1/devices/startactivation/:serial_number","host":["{{base_url}}"],"path":["v1","devices","startactivation",":serial_number"],"variable":[{"key":"serial_number","value":"<string>","description":"Base Serial Number"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"device_id\": 1000001,\n        \"activation_code\": \"1FD02A0AE02E8961E0637D14000A2AB3\",\n        \"activation_code_expires_on\": \"2024-08-16T17:08:04.000000Z\"\n    }\n}"}],"_postman_id":"b2162e58-77a3-4c60-80ac-1481283881b2"},{"name":"Activate Base Device","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","","    pm.expect(responseData.response.device_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.site_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.location_id).to.exist.and.to.be.a('number');","    ","    pm.expect(responseData.response).to.have.property('base_device_id');","    if(responseData.response.base_device_id) pm.expect(responseData.response.base_device_id).to.be.a('number');","    ","    pm.expect(responseData.response.device_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.status).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.device_type_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.model_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.device_version).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.serial_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.software_version).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.effective_date).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.expiration_date).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_positive_disc_id');","    if(responseData.response.control_positive_disc_id) pm.expect(responseData.response.control_positive_disc_id).to.exist.and.to.be.a('number');","    ","    pm.expect(responseData.response).to.have.property('control_positive_result');","    if(responseData.response.control_positive_result) pm.expect(responseData.response.control_positive_result).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_positive_last_run_on');","    if(responseData.response.control_positive_last_run_on) pm.expect(responseData.response.control_positive_last_run_on).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_negative_disc_id');","    if(responseData.response.control_negative_disc_id) pm.expect(responseData.response.control_negative_disc_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('control_negative_result');","    if(responseData.response.control_negative_result) pm.expect(responseData.response.control_negative_result).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('control_negative_last_run_on');","    if(responseData.response.control_negative_last_run_on) pm.expect(responseData.response.control_negative_last_run_on).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('port_number');","    if(responseData.response.port_number) pm.expect(responseData.response.port_number).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('comments');","    if(responseData.response.comments) pm.expect(responseData.response.comments).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('activated_on');","    if(responseData.response.activated_on) pm.expect(responseData.response.activated_on).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","","    pm.collectionVariables.set('site_id', responseData.response.site_id);","    pm.collectionVariables.set('location_id', responseData.response.location_id);","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Health Check\");","}"],"type":"text/javascript","packages":{},"id":"d7c2a1a4-7a3d-4f64-952e-7afcf4e68e38"}}],"id":"13f395a3-5af2-4dc0-9d27-d0eec1ae4e74","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PUT","header":[{"key":"X-AMDI-ACTIVATION-CODE","value":"","description":"<p>Activation Code</p>\n","type":"text"}],"url":"{{base_url}}/v1/devices/:device_id/activate","urlObject":{"path":["v1","devices",":device_id","activate"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"43688dcb-f96f-4d9d-8cd6-8f9f7dce9a30","description":{"content":"<p>Device ID</p>\n","type":"text/plain"},"type":"any","value":"","key":"device_id"}]}},"response":[{"id":"ca694adc-069f-4ad1-ab82-faa3195f14e4","name":"Activate Device","originalRequest":{"method":"PUT","header":[{"key":"X-AMDI-ACTIVATION-CODE","value":"<string>","description":"Activation Code","type":"text"}],"url":{"raw":"{{base_url}}/v1/devices/:device_id/activate","host":["{{base_url}}"],"path":["v1","devices",":device_id","activate"],"variable":[{"key":"device_id","value":"<integer>","description":"Device ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","name":"Content-Type","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"device_id\": 1000001,\n        \"org_id\": 1000001,\n        \"site_id\": 1000001,\n        \"location_id\": 1000001,\n        \"device_name\": \"Device\",\n        \"status\": \"online\",\n        \"device_type_id\": 1000001,\n        \"model_number\": \"alpha\",\n        \"serial_number\": \"DEVICETEST1000001\",\n        \"software_version\": \"v1.00.00\",\n        \"recipe_version\": \"v1.00.00\",\n        \"comments\": \"This is a test\",\n        \"control_positive_disc_id\": 1000001,\n        \"control_positive_result\": \"failed\",\n        \"control_positive_last_run_on\": \"2024-01-01T00:00:00.000000Z\",\n        \"control_negative_disc_id\": 1000001,\n        \"control_negative_result\": \"failed\",\n        \"control_negative_last_run_on\": \"2024-01-01T00:00:00.000000Z\",\n        \"active\": true\n    }\n}"}],"_postman_id":"13f395a3-5af2-4dc0-9d27-d0eec1ae4e74"},{"name":"Software Update","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.base_device_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.software_version).to.exist.and.to.eql('v00.00.00');","    pm.expect(responseData.response.release_start_dt).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.release_start_time).to.exist.and.to.eql('03:00 AM');","    pm.expect(responseData.response.software_package_url).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.software_package_md5_sum).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.software_package_url_expiration_ts).to.exist.and.to.be.a('string');","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Search Last X PHI Disc\");","}"],"type":"text/javascript","packages":{},"id":"49bac471-7b18-4c93-885a-cdbecca585ab"}}],"id":"603aa478-52ce-493b-9fab-11915ea5eb8b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/v1/devices/softwareupdate","urlObject":{"path":["v1","devices","softwareupdate"],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"603aa478-52ce-493b-9fab-11915ea5eb8b"}],"id":"7f48e1a8-9912-49f3-a1cb-b7e8b05c34b3","description":"<p>Manages devices (base station's and operating modules) by providing endpoints to list, search, retrieve, update, and perform health checks on instruments.</p>\n","_postman_id":"7f48e1a8-9912-49f3-a1cb-b7e8b05c34b3","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}}},{"name":"Patients","item":[{"name":"Get or Create Patient","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.response.patient_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.patient_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.first_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.last_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.gender).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.birth_date).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","});","","pm.collectionVariables.set('test_patient_id', responseData.response.patient_id);","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Get Patient\")","}"],"type":"text/javascript","packages":{},"id":"40c984b6-8db4-4ccf-9bdf-eb711c933f68"}},{"listen":"prerequest","script":{"exec":[""],"type":"text/javascript","packages":{},"id":"6f701219-cb5f-4243-9507-a698ff313523"}}],"id":"a4087dfc-1fd5-4e65-945b-0805c7a286e7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{   \n    \"patient_number\": \"\",\n    \"first_name\":\"\",\n    \"last_name\": \"\",\n    \"gender\": \"\",\n    \"birth_date\": \"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/patients/","description":"<p>Creates a new patient record with the provided information.</p>\n<p>See below more information of the payload's attributes:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Data Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>patient_number</td>\n<td>string</td>\n<td>Patient Number</td>\n</tr>\n<tr>\n<td>first_name</td>\n<td>string</td>\n<td>First Name</td>\n</tr>\n<tr>\n<td>last_name</td>\n<td>string</td>\n<td>Last Name</td>\n</tr>\n<tr>\n<td>gender</td>\n<td>string</td>\n<td>Gender. LOV: male, female</td>\n</tr>\n<tr>\n<td>birth_date</td>\n<td>string</td>\n<td>Date of birth in format ISO-8601 for example 1961-01-01</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["v1","patients",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[{"id":"fe2bb034-fae5-463c-a093-6c46ace08f4e","name":"Get or Create Patient","originalRequest":{"method":"POST","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Organization's Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID"}],"body":{"mode":"raw","raw":"{   \n    \"patient_number\": \"<string>\",\n    \"first_name\":\"<string>\",\n    \"last_name\": \"<string>\",\n    \"gender\": \"<string>\",\n    \"birth_date\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"<API Base URL>/v1/patients/"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"patient_id\": 1000001,\n        \"org_id\": 1000001,\n        \"first_name\": \"Joe\",\n        \"last_name\": \"Sic\",\n        \"gender\": \"male\",\n        \"birth_date\": \"1961-01-01\",\n        \"active\": true\n    }\n}"}],"_postman_id":"a4087dfc-1fd5-4e65-945b-0805c7a286e7"},{"name":"Get Patient","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.response.patient_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.patient_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.first_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.last_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.gender).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.birth_date).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","});","","pm.collectionVariables.set('test_patient_id', responseData.response.patient_id);","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Get or Activate Disc\");","}"],"type":"text/javascript","packages":{},"id":"034c96df-cc14-4b17-901e-fa170739d23a"}},{"listen":"prerequest","script":{"exec":["pm.collectionVariables.set('patient_id', pm.collectionVariables.get('test_patient_id'))"],"type":"text/javascript","packages":{},"id":"6719751d-bf91-406c-a0ed-81fed31df363"}}],"id":"d43d477a-e59f-4abf-a1d8-2155e91d222a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/v1/patients/:patient_id","description":"<p>Retrieves detailed information about a specific patient identified by their unique identifier.</p>\n","urlObject":{"path":["v1","patients",":patient_id"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"d095a0e0-7295-41dd-9d8e-815ea37c3b7f","description":{"content":"<p>Patient ID</p>\n","type":"text/plain"},"type":"any","value":"","key":"patient_id"}]}},"response":[{"id":"c39d053c-2e4d-4860-91be-ebd8c38a6a01","name":"Get Patient","originalRequest":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Organization's Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID"}],"url":{"raw":"<API Base URL>/v1/patients/:patient_id","host":["<API Base URL>"],"path":["v1","patients",":patient_id"],"variable":[{"key":"patient_id","value":"<integer>","description":"Patient ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"patient_id\": 1000001,\n        \"org_id\": 1000001,\n        \"first_name\": \"Joe\",\n        \"middle_name\": \"V.\",\n        \"last_name\": \"Sic\",\n        \"gender\": \"male\",\n        \"birth_date\": \"1961-01-01\",\n        \"active\": true\n    }\n}"}],"_postman_id":"d43d477a-e59f-4abf-a1d8-2155e91d222a"},{"name":"Update Patient","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.response.patient_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.patient_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.first_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.last_name).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.gender).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.birth_date).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","});","","pm.collectionVariables.set('test_patient_id', responseData.response.patient_id);","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Get Patient\")","}"],"type":"text/javascript","packages":{},"id":"ccb61fef-6a05-49d4-a3a3-eb1701628d65"}},{"listen":"prerequest","script":{"exec":[""],"type":"text/javascript","packages":{},"id":"44d64aa3-c60d-4cb9-8f7a-f5bb88a897a1"}}],"id":"e8ab6e0b-b546-4295-bba8-71d7bba66c37","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{   \n    \"first_name\":\"\",\n    \"last_name\": \"\",\n    \"gender\": \"\",\n    \"birth_date\": \"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/patients/:patient_id","urlObject":{"path":["v1","patients",":patient_id"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"f6028e49-8f58-4ef3-af54-1e89c926a29c","type":"any","value":"","key":"patient_id"}]}},"response":[{"id":"ef7ed55c-bcbf-4a41-a906-7c3cb756716e","name":"Get or Create Patient","originalRequest":{"method":"POST","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Organization's Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID"}],"body":{"mode":"raw","raw":"{   \n    \"patient_number\": \"<string>\",\n    \"first_name\":\"<string>\",\n    \"last_name\": \"<string>\",\n    \"gender\": \"<string>\",\n    \"birth_date\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"<API Base URL>/v1/patients/"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"patient_id\": 1000001,\n        \"org_id\": 1000001,\n        \"first_name\": \"Joe\",\n        \"last_name\": \"Sic\",\n        \"gender\": \"male\",\n        \"birth_date\": \"1961-01-01\",\n        \"active\": true\n    }\n}"}],"_postman_id":"e8ab6e0b-b546-4295-bba8-71d7bba66c37"}],"id":"f2e24624-985e-4c81-a74b-13edc77a23dc","description":"<p>Handles patient records, allowing users to list, search, retrieve, create, update, and delete patient information.</p>\n","_postman_id":"f2e24624-985e-4c81-a74b-13edc77a23dc","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}}},{"name":"Disc","item":[{"name":"Get Disc","id":"34e4c85f-900c-466b-a381-88ee6591519d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url}}/v1/disc/:disc_id","description":"<p>Retrieves detailed information about a specific disc identified by its unique identifier.</p>\n","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}},"urlObject":{"path":["v1","disc",":disc_id"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"ef5eb887-3868-47a7-b81e-75aef43a7449","description":{"content":"<p>Disc ID</p>\n","type":"text/plain"},"type":"any","value":"<integer>","key":"disc_id"}]}},"response":[{"id":"f06de166-deac-4cae-a1c2-25ffa798de00","name":"Get Disc","originalRequest":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID"}],"url":{"raw":"<API Base URL>/v1/disc/:disc_id","host":["<API Base URL>"],"path":["v1","disc",":disc_id"],"variable":[{"key":"disc_id","value":"<integer>","description":"Disc ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"disc_id\": 1000001,\n        \"serial_number\": \"DISCTEST1000001\",\n        \"patient_id\": 1000001,\n        \"org_id\": 1000001,\n        \"site_id\": 1000001,\n        \"active\": true,\n        \"status\": \"active\",\n        \"base_device_id\": 1000001,\n        \"operating_module_id\": 1000001,\n        \"software_version\": \"v1.00.00\",\n        \"recipe_version\": \"v1.00.00\",\n        \"run_start_date\": \"2024-01-01T00:00:00.000000Z\",\n        \"comments\": \"This is a test\"\n    }\n}"}],"_postman_id":"34e4c85f-900c-466b-a381-88ee6591519d"},{"name":"Get or Activate Disc","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.response.disc_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.serial_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.site_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.location_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","    pm.expect(responseData.response.status).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.base_device_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.operating_module_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('patient_id');","    if(responseData.response.patient_id) pm.expect(responseData.response.patient_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('control_lot_id');","    if(responseData.response.control_lot_id) pm.expect(responseData.response.control_lot_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('result');","    if(responseData.response.result) pm.expect(responseData.response.result).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('result_desc');","    if(responseData.response.result_desc) pm.expect(responseData.response.result_desc).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('software_version');","    if(responseData.response.software_version) pm.expect(responseData.response.software_version).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('result_desc');","    if(responseData.response.result_desc) pm.expect(responseData.response.result_desc).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('result_desc');","    if(responseData.response.result_desc) pm.expect(responseData.response.result_desc).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('run_start_date');","    if(responseData.response.run_start_date) pm.expect(responseData.response.run_start_date).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('run_end_date');","    if(responseData.response.run_end_date) pm.expect(responseData.response.run_end_date).to.exist.and.to.be.a('string');","","});","","if (pm.response.code == 200){","    if (responseData.response.control_lot_id == pm.collectionVariables.get('control_positive_control_lot_id')){","        pm.collectionVariables.set('control_positive_disc_id', responseData.response.disc_id);","    }else if (responseData.response.control_lot_id == pm.collectionVariables.get('control_negative_control_lot_id')){","        pm.collectionVariables.set('control_negative_disc_id', responseData.response.disc_id);","    }else{","        pm.collectionVariables.set('test_disc_id', responseData.response.disc_id);","    }","        ","    if (pm.collectionVariables.get('unit_testing') == 'true'){","        pm.execution.setNextRequest(\"Start Disc Test\");","    }","}"],"type":"text/javascript","packages":{},"id":"673db084-8c99-4480-a3fe-94e36e2f4788"}},{"listen":"prerequest","script":{"exec":["pm.collectionVariables.set('test_operator_id', pm.collectionVariables.get('operator_id'));","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    if (!pm.collectionVariables.get('control_positive_disc_run_end_date')){","        pm.collectionVariables.set('patient_id', null);","        pm.collectionVariables.set('control_lot_id', pm.collectionVariables.get('control_positive_control_lot_id'));","        pm.collectionVariables.set('disc_sn', pm.collectionVariables.get('control_positive_disc_sn'));","    }else if (!pm.collectionVariables.get('control_negative_disc_run_end_date')){","        pm.collectionVariables.set('patient_id', null);","        pm.collectionVariables.set('control_lot_id', pm.collectionVariables.get('control_negative_control_lot_id'));","        pm.collectionVariables.set('disc_sn', pm.collectionVariables.get('control_negative_disc_sn'));","    }else{","        pm.collectionVariables.set('control_lot_id', null);","        pm.collectionVariables.set('patient_id', pm.collectionVariables.get('test_patient_id'));","        pm.collectionVariables.set('disc_sn', pm.collectionVariables.get('test_disc_sn'));","    }","}",""],"type":"text/javascript","packages":{},"id":"635710a2-35ed-4a65-89aa-f60f4bd31fad"}}],"id":"4d2c4f1b-6633-4a53-8dbc-760d27395dd9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"patient_id\": ,\n    \"control_lot_id\": ,\n    \"serial_number\": \"\",\n    \"operator_id\": ,\n    \"operating_module_id\": \"\",\n    \"software_version\": \"\",\n    \"comments\": \"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/disc/","description":"<p>Retrieves detailed information about a specific disc identified by its unique identifier.</p>\n","urlObject":{"path":["v1","disc",""],"host":["{{base_url}}"],"query":[],"variable":[]}},"response":[{"id":"98abd937-2e99-45a1-ad77-c179b55fc6fd","name":"Get or Activate Disc","originalRequest":{"method":"POST","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"Operator ID"}],"body":{"mode":"raw","raw":"{\n    \"patient_id\": 1000001,\n    \"serial_number\": \"DISCTEST1000001\",\n    \"base_device_id\": 1000001,\n    \"operating_module_id\": 1000001,\n    \"software_version\": \"v1.00.00\",\n    \"comments\": \"This is a test\"\n}","options":{"raw":{"language":"json"}}},"url":"<API Base URL>/v1/disc/"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"disc_id\": 1000001,\n        \"serial_number\": \"DISCTEST1000001\",\n        \"patient_id\": 1000001,\n        \"org_id\": 1000001,\n        \"site_id\": 1000001,\n        \"location_id\": 1000001,\n        \"operator_id\": 1000001,\n        \"active\": true,\n        \"status\": \"active\",\n        \"base_device_id\": 1000001,\n        \"operating_module_id\": 1000001,\n        \"software_version\": \"v1.00.00\",\n        \"recipe_version\": \"v1.00.00\",\n        \"run_start_date\": \"2024-01-01T00:00:00.000000Z\",\n        \"comments\": \"This is a test\"\n    }\n}"}],"_postman_id":"4d2c4f1b-6633-4a53-8dbc-760d27395dd9"},{"name":"Upload Optics Files","event":[{"listen":"test","script":{"exec":["","const responseData = pm.response.json();","let total_parts = 45,","    part_seq = pm.collectionVariables.get('optics_file_upload_multipart_last_part') || 0;","","pm.test(`${pm.info.requestName} for ${pm.collectionVariables.get('test_type')} ${(part_seq == 51 ? 'Confirmation of multi-part' : 'Part #'+part_seq)} response status code is successful`, function () {","    try {","        pm.response.to.have.status(200);","    } catch (err) {","        console.error(\"Failed status code test. Response:\", pm.response.text());","        throw err; // rethrow to make the test actually fail","    }","});","","pm.test(`${pm.info.requestName} for ${pm.collectionVariables.get('test_type')} Part #${part_seq} has a valid response schema`, function () {","","    pm.expect(responseData).to.be.an('object');","","    if(part_seq == 51){","        pm.expect(responseData.response.disc_id).to.exist.and.to.be.a('number');","        pm.expect(responseData.response.disc_file_id).to.exist.and.to.be.a('number');","        pm.expect(responseData.response.file_type_id).to.exist.and.to.be.a('number');","        pm.expect(responseData.response.file_type).to.exist.and.to.be.a('string');","        pm.expect(responseData.response.file_name).to.exist.and.to.be.a('string');","        pm.expect(responseData.response.file_size).to.exist.and.to.be.a('number');","        pm.expect(responseData.response.mime_type).to.exist.and.to.be.a('string');","        pm.expect(responseData.response.timestamp).to.exist.and.to.be.a('string');","        if (responseData.response.md5_checksum) pm.expect(responseData.response.md5_checksum).to.exist.and.to.be.a('string');","    ","    }else{","        pm.expect(responseData.status).to.exist.and.to.be.a('string');","    }","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    total_parts = parseInt(total_parts);","    part_seq = parseInt(part_seq);","    ","    if (part_seq <= total_parts){","        // Still more parts to upload, call Upload Optics Files for the next part","        pm.execution.setNextRequest('Upload Optics Files');","    }else if(part_seq == total_parts){","        // Last part has been uploaded, make the last completion signal call","        pm.execution.setNextRequest('Upload Optics Files');","    }else{","        if(pm.environment.get('cancel_tests') == 'true'){","            pm.execution.setNextRequest('Cancel Disc Test');","        }else{","            pm.execution.setNextRequest('Get Disc Results');","        }","    }","}"],"type":"text/javascript","packages":{},"id":"2b4dcc67-2b38-4819-a1c9-e67a7ca346ec"}},{"listen":"prerequest","script":{"exec":["","const Header = require('postman-collection').Header;","const now = new Date();","const disc_test_run_start_date = now.toISOString().slice(0, 19)","","pm.request.upsertHeader(new Header({key:'X-AMDI-FILE-TIMESTAMP', value: disc_test_run_start_date}));","","","let total_parts = 45,","    part_seq = pm.collectionVariables.get('optics_file_upload_multipart_last_part') || 0;","","total_parts = parseInt(total_parts);","part_seq = parseInt(part_seq) + 1;","","if (part_seq <= total_parts){","    pm.request.removeHeader('X-AMDI-FILENAME');","    pm.request.removeHeader('X-AMDI-FILE-CHECKSUM');","    pm.request.upsertHeader(new Header({key:'X-AMDI-FILE-PART-SEQ', value: part_seq}));","    pm.request.upsertHeader(new Header({key:'X-AMDI-FILE-ENCRYPTED-IND', value: 'Y'}));","    pm.request.upsertHeader(new Header({key:'Content-Type', value: 'application/x-tgz'}));","    pm.request.body.file = `unit_testing_optics/part.${part_seq}.tar.gz`;","}else{","    pm.request.removeHeader('X-AMDI-FILE-PART-SEQ');","    pm.request.removeHeader('X-AMDI-FILENAME');","    pm.request.upsertHeader(new Header({key:'X-AMDI-FILE-ENCRYPTED-IND', value: 'Y'}));","    pm.request.upsertHeader(new Header({key:'X-AMDI-FILE-CHECKSUM', value: pm.variables.get('optics_file_upload_multipart_checksum')}));","    pm.request.removeHeader('Content-Type');","    pm.request.body.file = null;","}","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.collectionVariables.set('optics_file_upload_multipart_last_part', part_seq);","}"],"type":"text/javascript","packages":{},"id":"13d803de-0e3d-4462-b89e-bebcd61afaa5"}}],"id":"586c3492-56d2-4a24-afe8-2fc4c1c44d27","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[{"key":"X-AMDI-FILE-TIMESTAMP","value":"<string>","description":"<p>Optics File Timestamp</p>\n","type":"text"},{"key":"X-AMDI-FILE-PART-SEQ","value":"{{optics_file_upload_part_seq}}","description":"<p>Multi-part file upload sequence number</p>\n","type":"text"},{"key":"X-AMDI-FILENAME","value":"{{optics_file_upload_filename}}","description":"<p>Optics Filename</p>\n","type":"text"},{"key":"X-AMDI-FILE-CHECKSUM","value":"{{optics_file_upload_checksum}}","description":"<p>Optics File MD5 Checksum</p>\n","type":"text"},{"key":"X-AMDI-FILE-ENCRYPTED-IND","value":"<string>","description":"<p>Optics File Encrypted Indicator (LOV: Y, N)</p>\n","type":"text"},{"key":"Content-Type","value":"{{optics_file_upload_mime_type}}","description":"<p>Optics File Content Type (LOV: application/zip, application/x-zip-compressed, application/gzip, application/x-gzip, application/x-gzip-compressed, application/x-tgz, application/x-gtar, text/csv)</p>\n","type":"text"}],"body":{"mode":"file","file":{"src":""}},"url":"{{base_url}}/v1/disc/:disc_id/files/optics/upload","urlObject":{"path":["v1","disc",":disc_id","files","optics","upload"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"c800e8a1-544c-4513-83f8-67897e41b06a","description":{"content":"<p>Disc ID</p>\n","type":"text/plain"},"type":"any","value":"","key":"disc_id"}]}},"response":[{"id":"e6a84724-62ba-454c-b1c9-3baded581db8","name":"Upload Optics Files","originalRequest":{"method":"POST","header":[{"key":"X-AMDI-ORG-ID","value":"","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"","description":"Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"","description":"Operator ID"},{"key":"X-AMDI-FILENAME","value":"<string>","description":"Optics Filename"},{"key":"X-AMDI-FILE-UTC-TIMESTAMP","value":"<string>","description":"Optics File Timestamp UTC (ISO-8601 format)"}],"body":{"mode":"file","file":{}},"url":{"raw":"{{base_url}}/v1/disc/:disc_id/files/optics/upload","host":["{{base_url}}"],"path":["v1","disc",":disc_id","files","optics","upload"],"variable":[{"key":"disc_id","value":"<integer>","description":"Disc ID"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"disc_file_id\": 1000001,\n        \"disc_id\": 1000001,\n        \"file_type_id\": 1000001,\n        \"file_type\": \"optics\",\n        \"file_name\": \"1000001.240425T114945_Optics.csv\",\n        \"timestamp\": \"2024-01-01T00:00:00.000000Z\"\n    }\n}"}],"_postman_id":"586c3492-56d2-4a24-afe8-2fc4c1c44d27"},{"name":"Start Disc Test","event":[{"listen":"test","script":{"exec":["","const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} for ${pm.collectionVariables.get('test_type')} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} for ${pm.collectionVariables.get('test_type')} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.response.disc_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.serial_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.site_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.location_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","    pm.expect(responseData.response.status).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.base_device_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.operating_module_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('patient_id');","    if(responseData.response.patient_id) pm.expect(responseData.response.patient_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('control_lot_id');","    if(responseData.response.control_lot_id) pm.expect(responseData.response.control_lot_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('result');","    if(responseData.response.result) pm.expect(responseData.response.result).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('result_desc');","    if(responseData.response.result_desc) pm.expect(responseData.response.result_desc).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('software_version');","    if(responseData.response.software_version) pm.expect(responseData.response.software_version).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('result_desc');","    if(responseData.response.result_desc) pm.expect(responseData.response.result_desc).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('result_desc');","    if(responseData.response.result_desc) pm.expect(responseData.response.result_desc).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response.run_start_date).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('run_end_date');","    if(responseData.response.run_end_date) pm.expect(responseData.response.run_end_date).to.exist.and.to.be.a('string');","","});","","if(responseData.response.disc_id == pm.collectionVariables.get('control_positive_disc_id')){","    pm.collectionVariables.set('control_positive_disc_run_start_date', responseData.response.run_start_date)","}else if(responseData.response.disc_id == pm.collectionVariables.get('control_negative_disc_id')){","    pm.collectionVariables.set('control_negative_disc_run_start_date', responseData.response.run_start_date)","}else if(responseData.response.disc_id == pm.collectionVariables.get('test_disc_id')){","    pm.collectionVariables.set('test_disc_run_start_date', responseData.response.run_start_date)","}","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Upload Optics Files\");","}"],"type":"text/javascript","packages":{},"id":"f72bb610-730f-4df7-be15-9d8b77776f1b"}},{"listen":"prerequest","script":{"exec":["const now = new Date();","const disc_test_run_start_date = now.toISOString().slice(0, 19)","","pm.collectionVariables.set('disc_test_run_start_date', disc_test_run_start_date);","","if(!pm.collectionVariables.get('control_positive_disc_run_end_date')){","    pm.collectionVariables.set('disc_id', pm.collectionVariables.get('control_positive_disc_id'));","    pm.collectionVariables.set('optics_file_upload_multipart_last_part', '0');","    pm.collectionVariables.set('test_type', 'POSITIVE Control');","}else if(!pm.collectionVariables.get('control_negative_disc_run_end_date')){","    pm.collectionVariables.set('disc_id', pm.collectionVariables.get('control_negative_disc_id'));","    pm.collectionVariables.set('optics_file_upload_multipart_last_part', '0');","    pm.collectionVariables.set('test_type', 'NEGATIVE Control');","}else{","    pm.collectionVariables.set('disc_id', pm.collectionVariables.get('test_disc_id'));","    pm.collectionVariables.set('optics_file_upload_multipart_last_part', '0');","    pm.collectionVariables.set('test_type', 'PATIENT');","}"],"type":"text/javascript","packages":{},"id":"441b55dd-e40f-4d81-98b5-b93272a9c0e8"}}],"id":"c7203201-14a3-404b-8b73-4b8e6e169abd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"run_start_date\": \"{{disc_test_run_start_date}}\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/disc/:disc_id/starttest","urlObject":{"path":["v1","disc",":disc_id","starttest"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"8f047672-ea26-45f7-b8d8-56405bed45c2","description":{"content":"<p>Disc ID</p>\n","type":"text/plain"},"type":"any","value":"","key":"disc_id"}]}},"response":[{"id":"d9b903d5-1b3d-4dd2-bed5-172058bc8e5d","name":"Upload Optics Files","originalRequest":{"method":"POST","header":[{"key":"X-AMDI-ORG-ID","value":"","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"","description":"Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"","description":"Operator ID"},{"key":"X-AMDI-FILENAME","value":"<string>","description":"Optics Filename"},{"key":"X-AMDI-FILE-UTC-TIMESTAMP","value":"<string>","description":"Optics File Timestamp UTC (ISO-8601 format)"}],"body":{"mode":"file","file":{}},"url":{"raw":"{{base_url}}/v1/disc/:disc_id/files/optics/upload","host":["{{base_url}}"],"path":["v1","disc",":disc_id","files","optics","upload"],"variable":[{"key":"disc_id","value":"<integer>","description":"Disc ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"disc_file_id\": 1000001,\n        \"disc_id\": 1000001,\n        \"file_type_id\": 1000001,\n        \"file_type\": \"optics\",\n        \"file_name\": \"1000001.240425T114945_Optics.csv\",\n        \"timestamp\": \"2024-01-01T00:00:00.000000Z\"\n    }\n}"}],"_postman_id":"c7203201-14a3-404b-8b73-4b8e6e169abd"},{"name":"Get Disc Results","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} for ${pm.collectionVariables.get('test_type')} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} for ${pm.collectionVariables.get('test_type')} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.response.disc_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.site_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.location_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.operator_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.status).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.serial_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","    pm.expect(responseData.response.base_device_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.operating_module_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('patient_id');","    if(responseData.response.patient_id) pm.expect(responseData.response.patient_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('control_lot_id');","    if(responseData.response.control_lot_id) pm.expect(responseData.response.control_lot_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('control_kit_lot_number');","    if(responseData.response.control_kit_lot_number) pm.expect(responseData.response.control_kit_lot_number).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('control_status');","    if(responseData.response.control_status) pm.expect(responseData.response.control_status).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('control_expected_result');","    if(responseData.response.control_expected_result) pm.expect(responseData.response.control_expected_result).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('result');","    if(responseData.response.result) pm.expect(responseData.response.result).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('result_desc');","    if(responseData.response.result_desc) pm.expect(responseData.response.result_desc).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('software_version');","    if(responseData.response.software_version) pm.expect(responseData.response.software_version).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('recipe_version');","    if(responseData.response.recipe_version) pm.expect(responseData.response.recipe_version).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('run_start_date');","    if(responseData.response.run_start_date) pm.expect(responseData.response.run_start_date).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('run_end_date');","    if(responseData.response.run_end_date) pm.expect(responseData.response.run_end_date).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('last_control_pos_disc_id');","    if(responseData.response.last_control_pos_disc_id) pm.expect(responseData.response.last_control_pos_disc_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('last_control_pos_result');","    if(responseData.response.last_control_pos_result) pm.expect(responseData.response.last_control_pos_result).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('last_control_pos_result_desc');","    if(responseData.response.last_control_pos_result_desc) pm.expect(responseData.response.last_control_pos_result_desc).to.exist.and.to.be.a('string');","   ","    pm.expect(responseData.response).to.have.property('last_control_pos_run_on');","    if(responseData.response.last_control_pos_run_on) pm.expect(responseData.response.last_control_pos_run_on).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('last_control_neg_disc_id');","    if(responseData.response.last_control_neg_disc_id) pm.expect(responseData.response.last_control_neg_disc_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('last_control_neg_result');","    if(responseData.response.last_control_neg_result) pm.expect(responseData.response.last_control_neg_result).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('last_control_neg_result_desc');","    if(responseData.response.last_control_neg_result_desc) pm.expect(responseData.response.last_control_neg_result_desc).to.exist.and.to.be.a('string');","   ","    pm.expect(responseData.response).to.have.property('last_control_neg_run_on');","    if(responseData.response.last_control_neg_run_on) pm.expect(responseData.response.last_control_neg_run_on).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('notes');","    if(responseData.response.notes) pm.expect(responseData.response.notes).to.exist.and.to.be.a('array');","","    pm.expect(responseData.response).to.have.property('targets');","    if(responseData.response.targets) pm.expect(responseData.response.targets).to.exist.and.to.be.a('array');","});","","if (responseData.response.status != 'processing'){","    ","    if(responseData.response.disc_id == pm.collectionVariables.get('control_positive_disc_id')){","        pm.collectionVariables.set('control_positive_disc_run_end_date', responseData.response.run_end_date)","    }else if(responseData.response.disc_id == pm.collectionVariables.get('control_negative_disc_id')){","        pm.collectionVariables.set('control_negative_disc_run_end_date', responseData.response.run_end_date)","    }else if(responseData.response.disc_id == pm.collectionVariables.get('test_disc_id')){","        pm.collectionVariables.set('test_disc_run_end_date', responseData.response.run_end_date)","    }","    ","}","","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    //Poll for results for as long as the disc shows processing","    if(responseData.response.status == 'processing'){","        setTimeout(()=> pm.execution.setNextRequest(\"Get Disc Results\"), 2000);","    }else{","        pm.execution.setNextRequest(\"Add Disc Note\")","    }","}"],"type":"text/javascript","packages":{},"id":"40be783a-c898-4408-bb41-a40e4b2f930b"}},{"listen":"prerequest","script":{"exec":[""],"type":"text/javascript","packages":{},"id":"690f7de9-98fe-4166-a704-16d2b57bfb0e"}}],"id":"68f4af6c-8560-405b-9c2c-ca67448aaa4c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/v1/disc/:disc_id/testresults","description":"<p>Retrieves the results of a specific test.</p>\n","urlObject":{"path":["v1","disc",":disc_id","testresults"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"70be5c72-d505-4cac-8e74-b42744a26420","description":{"content":"<p>Disc ID</p>\n","type":"text/plain"},"type":"any","value":"","key":"disc_id"}]}},"response":[{"id":"d7e900e5-7daf-4646-943e-6aefa339348b","name":"Get Disc Results","originalRequest":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"","description":"Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"","description":"Operator ID"}],"url":{"raw":"{{base_url}}/v1/disc/:disc_id/results","host":["{{base_url}}"],"path":["v1","disc",":disc_id","results"],"variable":[{"key":"disc_id","value":"<integer>","description":"Disc ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"disc_id\": 1000001,\n        \"org_id\": 1000001,\n        \"site_id\": 1000001,\n        \"patient_id\": 1000001,\n        \"base_device_id\": 1000001,\n        \"operating_module_id\": 1000001,\n        \"software_version\": \"v1.00.00\",\n        \"recipe_version\": \"v1.00.00\",\n        \"run_start_date\": \"2024-01-01T00:00:00.000000Z\",\n        \"run_end_date\": \"2024-01-01T00:00:00.000000Z\",\n        \"status\": \"completed\",\n        \"result\": \"positive\",\n        \"result_desc\": \"Positive\",\n        \"targets\": [\n            {\n                \"target_result_id\": 1000001,\n                \"target\": \"flua\",\n                \"target_desc\": \"Flu A\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            },\n            {\n                \"target_result_id\": 1000002,\n                \"target\": \"rhino\",\n                \"target_desc\": \"Rhino\",\n                \"target_result\": \"negative\",\n                \"target_result_desc\": \"Negative\"\n            },\n            {\n                \"target_result_id\": 1000003,\n                \"target\": \"rsv\",\n                \"target_desc\": \"RSV\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            },\n            {\n                \"target_result_id\": 1000004,\n                \"target\": \"sc2\",\n                \"target_desc\": \"SC2\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            },\n            {\n                \"target_result_id\": 1000005,\n                \"target\": \"flub\",\n                \"target_desc\": \"Flu B\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            }\n        ]\n    }\n}"},{"id":"9d9c4af8-7203-4475-b74e-cbb79f4ec5db","name":"Get Disc Results","originalRequest":{"method":"GET","header":[],"url":{"raw":"{{base_url}}/v1/disc/:disc_id/testresults","host":["{{base_url}}"],"path":["v1","disc",":disc_id","testresults"],"variable":[{"key":"disc_id","value":"","description":"Disc ID"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 20 Jan 2025 17:29:12 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"X-ORDS_DEBUG","value":"true"},{"key":"Cache-Control","value":"no-store"},{"key":"Pragma","value":"no-cache"},{"key":"Expires","value":"Sun, 27 Jul 1997 13:00:00 GMT"},{"key":"ETag","value":"\"BICK8Qwhy3lhDKiqdSKVL3MBhKZ/qWr/MapGcuJGHG4piBTtzW6BwMkGs1XFu2+d2crn2Hfs9KP8rle2NUETgQ==\""}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"disc_id\": 110563,\n        \"org_id\": 10049,\n        \"site_id\": 10078,\n        \"location_id\": 10094,\n        \"operator_id\": 10921,\n        \"serial_number\": \"00000132\",\n        \"patient_id\": 217423,\n        \"control_lot_id\": null,\n        \"control_kit_lot_number\": null,\n        \"control_expected_result\": null,\n        \"control_status\": null,\n        \"active\": true,\n        \"status\": \"completed\",\n        \"result\": \"invalid\",\n        \"result_desc\": \"Invalid\",\n        \"base_device_id\": 10214,\n        \"operating_module_id\": 10246,\n        \"software_version\": \"1.0.0\",\n        \"recipe_version\": null,\n        \"run_start_date\": \"2025-01-20T16:30:36.827757Z\",\n        \"run_end_date\": \"2025-01-20T16:39:20.611239Z\",\n        \"last_control_pos_disc_id\": null,\n        \"last_control_pos_result\": null,\n        \"last_control_pos_result_desc\": null,\n        \"last_control_pos_run_on\": null,\n        \"last_control_neg_disc_id\": null,\n        \"last_control_neg_result\": null,\n        \"last_control_neg_result_desc\": null,\n        \"last_control_neg_run_on\": null,\n        \"notes\": [\n            {\n                \"disc_note_id\": 9120,\n                \"note\": \"This is a test note\",\n                \"created_on\": \"2025-01-20T16:39:21.408065Z\",\n                \"created_by\": \"KHERRARTE\",\n                \"updated_on\": \"2025-01-20T16:39:21.408065Z\",\n                \"updated_by\": \"KHERRARTE\"\n            }\n        ],\n        \"targets\": [\n            {\n                \"target_result_id\": 565408,\n                \"target\": \"flua\",\n                \"target_desc\": \"Flu A\",\n                \"target_result\": \"invalid\",\n                \"target_result_desc\": \"Invalid\",\n                \"comments\": null\n            },\n            {\n                \"target_result_id\": 565409,\n                \"target\": \"flub\",\n                \"target_desc\": \"Flu B\",\n                \"target_result\": \"invalid\",\n                \"target_result_desc\": \"Invalid\",\n                \"comments\": null\n            },\n            {\n                \"target_result_id\": 565410,\n                \"target\": \"rsv\",\n                \"target_desc\": \"RSV\",\n                \"target_result\": \"invalid\",\n                \"target_result_desc\": \"Invalid\",\n                \"comments\": null\n            },\n            {\n                \"target_result_id\": 565411,\n                \"target\": \"rhino\",\n                \"target_desc\": \"Rhinovirus/Enterovirus\",\n                \"target_result\": \"invalid\",\n                \"target_result_desc\": \"Invalid\",\n                \"comments\": null\n            },\n            {\n                \"target_result_id\": 565412,\n                \"target\": \"sc2\",\n                \"target_desc\": \"SC2\",\n                \"target_result\": \"invalid\",\n                \"target_result_desc\": \"Invalid\",\n                \"comments\": null\n            }\n        ]\n    }\n}"}],"_postman_id":"68f4af6c-8560-405b-9c2c-ca67448aaa4c"},{"name":"Search Last X PHI Disc","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","// Add a test to check the response schema based on the response body","pm.test(\"Response schema is valid\", function () {","    pm.expect(responseData.items).to.exist.and.to.be.a('array');","    pm.expect(responseData.hasMore).to.exist.and.to.be.a('boolean');","    pm.expect(responseData.limit).to.exist.and.to.be.a('number');","    pm.expect(responseData.offset).to.exist.and.to.be.a('number');","    pm.expect(responseData.count).to.exist.and.to.be.a('number');","    pm.expect(responseData.links).to.exist.and.to.be.a('array');","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    pm.execution.setNextRequest(\"Get Control Kit\");","}"],"type":"text/javascript","packages":{},"id":"2f38ffc0-d0d8-429e-ab12-8a483dc75ee6"}},{"listen":"prerequest","script":{"exec":[""],"type":"text/javascript","packages":{},"id":"3a839c5d-054b-43fd-b330-83f9d3d09d25"}}],"id":"096d3eef-df88-4001-a8eb-b09d402d3d73","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/v1/phi/disc/lastx","description":"<p>Retrieves the results of a specific test.</p>\n","urlObject":{"path":["v1","phi","disc","lastx"],"host":["{{base_url}}"],"query":[{"disabled":true,"description":{"content":"<p>Operating Module Device ID</p>\n","type":"text/plain"},"key":"operating_module_id","value":"<integer>"},{"disabled":true,"description":{"content":"<p>Patient ID</p>\n","type":"text/plain"},"key":"patient_id","value":"<integer>"},{"disabled":true,"description":{"content":"<p>Patient Number</p>\n","type":"text/plain"},"key":"patient_number","value":"<string>"},{"disabled":true,"description":{"content":"<p>First Name</p>\n","type":"text/plain"},"key":"first_name","value":"<string>"},{"disabled":true,"description":{"content":"<p>Last Name</p>\n","type":"text/plain"},"key":"last_name","value":"<string>"},{"disabled":true,"description":{"content":"<p>Birth Date in format ISO-8601</p>\n","type":"text/plain"},"key":"birth_date","value":"<string>"},{"disabled":true,"description":{"content":"<p>Gener (LOV: male, female, null)</p>\n","type":"text/plain"},"key":"gender","value":"<string>"},{"disabled":true,"description":{"content":"<p>Disc Status (LOV: active, expired, processing, discarded, completed, error)</p>\n","type":"text/plain"},"key":"status","value":"<string>"},{"disabled":true,"description":{"content":"<p>Software Version used to process Optics for the Disc</p>\n","type":"text/plain"},"key":"software_version","value":"<string>"},{"disabled":true,"description":{"content":"<p>Recipe Version used to process Optics for the Disc</p>\n","type":"text/plain"},"key":"recipe_version","value":"<string>"},{"disabled":true,"description":{"content":"<p>Number of results to return</p>\n","type":"text/plain"},"key":"limit","value":"<integer>"},{"disabled":true,"description":{"content":"<p>Pagination control for the number of results</p>\n","type":"text/plain"},"key":"offset","value":"<integer>"}],"variable":[]}},"response":[{"id":"ea7e5284-9c64-42bf-979e-c31510b649de","name":"Get Disc Results","originalRequest":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"","description":"Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"","description":"Operator ID"}],"url":{"raw":"{{base_url}}/v1/disc/:disc_id/results","host":["{{base_url}}"],"path":["v1","disc",":disc_id","results"],"variable":[{"key":"disc_id","value":"<integer>","description":"Disc ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"disc_id\": 1000001,\n        \"org_id\": 1000001,\n        \"site_id\": 1000001,\n        \"patient_id\": 1000001,\n        \"base_device_id\": 1000001,\n        \"operating_module_id\": 1000001,\n        \"software_version\": \"v1.00.00\",\n        \"recipe_version\": \"v1.00.00\",\n        \"run_start_date\": \"2024-01-01T00:00:00.000000Z\",\n        \"run_end_date\": \"2024-01-01T00:00:00.000000Z\",\n        \"status\": \"completed\",\n        \"result\": \"positive\",\n        \"result_desc\": \"Positive\",\n        \"targets\": [\n            {\n                \"target_result_id\": 1000001,\n                \"target\": \"flua\",\n                \"target_desc\": \"Flu A\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            },\n            {\n                \"target_result_id\": 1000002,\n                \"target\": \"rhino\",\n                \"target_desc\": \"Rhino\",\n                \"target_result\": \"negative\",\n                \"target_result_desc\": \"Negative\"\n            },\n            {\n                \"target_result_id\": 1000003,\n                \"target\": \"rsv\",\n                \"target_desc\": \"RSV\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            },\n            {\n                \"target_result_id\": 1000004,\n                \"target\": \"sc2\",\n                \"target_desc\": \"SC2\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            },\n            {\n                \"target_result_id\": 1000005,\n                \"target\": \"flub\",\n                \"target_desc\": \"Flu B\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            }\n        ]\n    }\n}"}],"_postman_id":"096d3eef-df88-4001-a8eb-b09d402d3d73"},{"name":"Cancel Disc Test","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} for ${pm.collectionVariables.get('test_type')} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} for ${pm.collectionVariables.get('test_type')} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.response.disc_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.site_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.location_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.operator_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.status).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.status).to.be.eq('cancelled');","    pm.expect(responseData.response.serial_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.active).to.exist.and.to.be.a('boolean');","    pm.expect(responseData.response.base_device_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.operating_module_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('patient_id');","    if(responseData.response.patient_id) pm.expect(responseData.response.patient_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('control_lot_id');","    if(responseData.response.control_lot_id) pm.expect(responseData.response.control_lot_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('control_kit_lot_number');","    if(responseData.response.control_kit_lot_number) pm.expect(responseData.response.control_kit_lot_number).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('control_status');","    if(responseData.response.control_status) pm.expect(responseData.response.control_status).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('control_expected_result');","    if(responseData.response.control_expected_result) pm.expect(responseData.response.control_expected_result).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('result');","    if(responseData.response.result) pm.expect(responseData.response.result).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('result_desc');","    if(responseData.response.result_desc) pm.expect(responseData.response.result_desc).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('software_version');","    if(responseData.response.software_version) pm.expect(responseData.response.software_version).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('recipe_version');","    if(responseData.response.recipe_version) pm.expect(responseData.response.recipe_version).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('run_start_date');","    if(responseData.response.run_start_date) pm.expect(responseData.response.run_start_date).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('run_end_date');","    if(responseData.response.run_end_date) pm.expect(responseData.response.run_end_date).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('last_control_pos_disc_id');","    if(responseData.response.last_control_pos_disc_id) pm.expect(responseData.response.last_control_pos_disc_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('last_control_pos_result');","    if(responseData.response.last_control_pos_result) pm.expect(responseData.response.last_control_pos_result).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('last_control_pos_result_desc');","    if(responseData.response.last_control_pos_result_desc) pm.expect(responseData.response.last_control_pos_result_desc).to.exist.and.to.be.a('string');","   ","    pm.expect(responseData.response).to.have.property('last_control_pos_run_on');","    if(responseData.response.last_control_pos_run_on) pm.expect(responseData.response.last_control_pos_run_on).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('last_control_neg_disc_id');","    if(responseData.response.last_control_neg_disc_id) pm.expect(responseData.response.last_control_neg_disc_id).to.exist.and.to.be.a('number');","","    pm.expect(responseData.response).to.have.property('last_control_neg_result');","    if(responseData.response.last_control_neg_result) pm.expect(responseData.response.last_control_neg_result).to.exist.and.to.be.a('string');","    ","    pm.expect(responseData.response).to.have.property('last_control_neg_result_desc');","    if(responseData.response.last_control_neg_result_desc) pm.expect(responseData.response.last_control_neg_result_desc).to.exist.and.to.be.a('string');","   ","    pm.expect(responseData.response).to.have.property('last_control_neg_run_on');","    if(responseData.response.last_control_neg_run_on) pm.expect(responseData.response.last_control_neg_run_on).to.exist.and.to.be.a('string');","","    pm.expect(responseData.response).to.have.property('notes');","    if(responseData.response.notes) pm.expect(responseData.response.notes).to.exist.and.to.be.a('array');","","    pm.expect(responseData.response).to.have.property('targets');","    if(responseData.response.targets) pm.expect(responseData.response.targets).to.exist.and.to.be.a('array');","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    if(pm.environment.get('cancel_tests') == 'true'){","        if(!pm.collectionVariables.get('test_disc_run_end_date')){","            pm.execution.setNextRequest('Get Disc Results');","        }else{","            pm.environment.set('cancel_tests', 'false')","            pm.execution.setNextRequest('Get Disc Results');","        }","    }else{","        console.log(`Test operators API`);","        pm.execution.setNextRequest('List & Search Operator Types');","    }","}"],"type":"text/javascript","packages":{},"id":"f0fa7cb6-897b-464c-a67d-0cf5cf7096d5"}}],"id":"cdad4998-2de5-4e4c-b15f-ff045b80a2de","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"url":"{{base_url}}/v1/disc/:disc_id/canceltest","description":"<p>Updates the information of a specific test.</p>\n","urlObject":{"path":["v1","disc",":disc_id","canceltest"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"07df2bd6-f6ee-40ec-bb96-a98ae9969297","description":{"content":"<p>Disc ID</p>\n","type":"text/plain"},"type":"any","value":"","key":"disc_id"}]}},"response":[{"id":"d1f7bfd6-fd8c-46f7-a8cd-666d7b7a89e2","name":"Update Disc Results","originalRequest":{"method":"PUT","header":[{"key":"X-AMDI-ORG-ID","value":"","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"","description":"Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"","description":"User ID"}],"body":{"mode":"raw","raw":"{\n    \"comments\":\"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{base_url}}/v1/disc/:disc_id/results/","host":["{{base_url}}"],"path":["v1","disc",":disc_id","results",""],"variable":[{"key":"disc_id","value":"<integer>","description":"Disc ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"disc_id\": 1000001,\n        \"org_id\": 1000001,\n        \"site_id\": 1000001,\n        \"patient_id\": 1000001,\n        \"base_device_id\": 1000001,\n        \"operating_module_id\": 1000001,\n        \"software_version\": \"v1.00.00\",\n        \"recipe_version\": \"v1.00.00\",\n        \"run_start_date\": \"2024-01-01T00:00:00.000000Z\",\n        \"run_end_date\": \"2024-01-01T00:00:00.000000Z\",\n        \"status\": \"completed\",\n        \"result\": \"positive\",\n        \"result_desc\": \"Positive\",\n        \"targets\": [\n            {\n                \"target_result_id\": 1000001,\n                \"target\": \"flua\",\n                \"target_desc\": \"Flu A\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            },\n            {\n                \"target_result_id\": 1000002,\n                \"target\": \"rhino\",\n                \"target_desc\": \"Rhino\",\n                \"target_result\": \"negative\",\n                \"target_result_desc\": \"Negative\"\n            },\n            {\n                \"target_result_id\": 1000003,\n                \"target\": \"rsv\",\n                \"target_desc\": \"RSV\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            },\n            {\n                \"target_result_id\": 1000004,\n                \"target\": \"sc2\",\n                \"target_desc\": \"SC2\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            },\n            {\n                \"target_result_id\": 1000005,\n                \"target\": \"flub\",\n                \"target_desc\": \"Flu B\",\n                \"target_result\": \"positive\",\n                \"target_result_desc\": \"Positive\"\n            }\n        ]\n    }\n}"}],"_postman_id":"cdad4998-2de5-4e4c-b15f-ff045b80a2de"},{"name":"Add Disc Note","event":[{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} for ${pm.collectionVariables.get('test_type')} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","","pm.test(`${pm.info.requestName} for ${pm.collectionVariables.get('test_type')} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","    pm.expect(responseData.response.disc_note_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.org_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.disc_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.operator_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.note).to.exist.and.to.be.a('string');","});","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    if(!pm.collectionVariables.get('control_positive_disc_run_end_date')){","        console.log(`Routing to Get Control Kit for POSITIVE control`);","        pm.execution.setNextRequest('Get Control Kit');","    }else if(!pm.collectionVariables.get('control_negative_disc_run_end_date')){","        console.log(`Routing to Get Control Kit for NEGATIVE control`);","        pm.execution.setNextRequest('Get Control Kit');","    }else if(!pm.collectionVariables.get('test_disc_run_end_date')){","        console.log(`Routing to Get Control Kit for PATIENT`);","        pm.execution.setNextRequest('Get or Create Patient');","    }else{","        pm.execution.setNextRequest('Cancel Disc Test');","    }","}"],"type":"text/javascript","packages":{},"id":"57062aa1-5073-461b-a62e-027c48eadbfa"}},{"listen":"prerequest","script":{"exec":["pm.collectionVariables.set('disc_note_text','This is a test note from automated unit testing');"],"type":"text/javascript","packages":{},"id":"0e545c6a-8a89-41f2-a5a4-82af7082a94c"}}],"id":"4069031e-7bce-4249-8d88-c1e1ebed8524","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"note\":\"{{disc_note_text}}\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/disc/:disc_id/notes","urlObject":{"path":["v1","disc",":disc_id","notes"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"3b682d77-52ff-405b-b03e-f5e2c7409119","description":{"content":"<p>Disc ID</p>\n","type":"text/plain"},"type":"any","value":"","key":"disc_id"}]}},"response":[],"_postman_id":"4069031e-7bce-4249-8d88-c1e1ebed8524"},{"name":"Update Disc Note","id":"af1c79b4-473b-48de-bbdd-a5b0f4b0a20e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"note\":\"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/disc/:disc_id/notes/:disc_note_id","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}},"urlObject":{"path":["v1","disc",":disc_id","notes",":disc_note_id"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"58440683-32f9-4894-9a8c-dc279fd25882","description":{"content":"<p>Disc ID</p>\n","type":"text/plain"},"type":"any","value":"<integer>","key":"disc_id"},{"id":"3215582b-a56d-4f96-97f5-723dac2d0635","description":{"content":"<p>Disc Note ID</p>\n","type":"text/plain"},"type":"any","value":"<integer>","key":"disc_note_id"}]}},"response":[],"_postman_id":"af1c79b4-473b-48de-bbdd-a5b0f4b0a20e"}],"id":"198c3663-a38d-4d8b-ba43-7af06bcdafdf","description":"<p>Handles disc operations, allowing users to list, search, retrieve, and update disc information.</p>\n","_postman_id":"198c3663-a38d-4d8b-ba43-7af06bcdafdf","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}}},{"name":"Controls (QC)","item":[{"name":"Get Control Kit","event":[{"listen":"prerequest","script":{"exec":["if (!pm.collectionVariables.get('control_positive_disc_run_end_date')){","    pm.collectionVariables.set('control_lot_kit_nbr', pm.collectionVariables.get('control_positive_kit_nbr'));","}else if(!pm.collectionVariables.get('control_negative_disc_run_end_date')){","    pm.collectionVariables.set('control_lot_kit_nbr', pm.collectionVariables.get('control_negative_kit_nbr'));","}"],"type":"text/javascript","packages":{},"id":"8cd2dee0-a467-4da2-b98d-52070668a257"}},{"listen":"test","script":{"exec":["const responseData = pm.response.json();","","pm.test(`${pm.info.requestName} response status code is successful`, function () {","    pm.response.to.have.status(200);","});","","pm.test(`${pm.info.requestName} has a valid response schema`, function () {","    pm.expect(responseData).to.be.an('object');","","    pm.expect(responseData.response.control_lot_id).to.exist.and.to.be.a('number');","    pm.expect(responseData.response.kit_lot_number).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.status).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.expected_result).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.expected_result_desc).to.exist.and.to.be.a('string');","    pm.expect(responseData.response.expiration_date).to.exist.and.to.be.a('string');","    ","});","","if(responseData.response.kit_lot_number == pm.collectionVariables.get('control_positive_kit_nbr')){","    pm.collectionVariables.set('control_positive_control_lot_id', responseData.response.control_lot_id);","}else if(responseData.response.kit_lot_number == pm.collectionVariables.get('control_negative_kit_nbr')){","    pm.collectionVariables.set('control_negative_control_lot_id', responseData.response.control_lot_id);","}","","if (pm.collectionVariables.get('unit_testing') == 'true'){","    if(!pm.collectionVariables.get('control_positive_disc_run_end_date')){","        pm.execution.setNextRequest(\"Get or Activate Disc\");","    }else if(!pm.collectionVariables.get('control_negative_disc_run_end_date')){","        pm.execution.setNextRequest(\"Get or Activate Disc\");","    }else{","        // If this request gets invoked unexpectedly and both positive and negative controls have been","        // run with the respective workflow, halt the execution of everything ","        pm.execution.setNextRequest(null);","    }","}"],"type":"text/javascript","packages":{},"id":"2bafcc9a-187d-48ff-862e-865cbf49ddae"}}],"id":"b8f7e83d-6778-4b82-92ee-190f8045f186","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"{{base_url}}/v1/controlkits/:kit_lot_number","urlObject":{"path":["v1","controlkits",":kit_lot_number"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"d2f13a81-b3a7-4c71-a803-f3274f441be7","description":{"content":"<p>Control Kit Lot Number</p>\n","type":"text/plain"},"type":"any","value":"","key":"kit_lot_number"}]}},"response":[{"id":"f5ba1201-df91-4dda-952e-34aff4953756","name":"Get or Activate Control","originalRequest":{"method":"POST","header":[{"key":"X-AMDI-ORG-ID","value":"","description":"Organization ID","type":"text"},{"key":"X-AMDI-SITE-ID","value":"","description":"Site ID","type":"text"},{"key":"X-AMDI-OPERATOR-ID","value":"","description":"Operator ID","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"serial_number\": \"<string>\",\n    \"expected_result\": \"<string>\",\n    \"comments\":\"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"{{base_url}}/v1/controls/"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"control_id\": 1000001,\n        \"org_id\": 1000001,\n        \"serial_number\": \"CONTROL_TEST_P1000001\",\n        \"expected_result\": \"positive\",\n        \"comments\": \"This is a test\"\n    }\n}"}],"_postman_id":"b8f7e83d-6778-4b82-92ee-190f8045f186"}],"id":"e640dc8e-8b09-43e7-94ec-2d4b2d1aff85","_postman_id":"e640dc8e-8b09-43e7-94ec-2d4b2d1aff85","description":"","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}}},{"name":"Sites","item":[{"name":"Get Site","id":"8c0dae78-fdf5-4998-903c-de7ed269fe34","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{base_url}}/v1/sites/:site_id","description":"<p>Retrieves detailed information about a specific site within the organization.</p>\n","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}},"urlObject":{"path":["v1","sites",":site_id"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"0baf7a03-1394-45aa-a26c-61cc653bd612","description":{"content":"<p>Site ID</p>\n","type":"text/plain"},"type":"any","value":"<integer>","key":"site_id"}]}},"response":[{"id":"03c6a5fa-a9df-4999-a66d-7e014d06ebd9","name":"Get Site","originalRequest":{"method":"GET","header":[],"url":"<API Base URL>/v1/sites/<integer>"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":""}],"cookie":[],"responseTime":null,"body":"{\n    \"site_id\": 10000,\n    \"site_number\": \"10000\",\n    \"site_name\": \"Los Angeles Downtown Walgreens\",\n    \"address\":\"123 Main Street\",\n    \"city\": \"Los Angeles\",\n    \"state\": \"CA\",\n    \"zip\": \"90037\",\n    \"country\": \"USA\",\n    \"clia_waived\": true,\n    \"clia_registration_number\": \"1234567890\",\n    \"clia_expiration_date\": \"12/31/2099\"\n}"}],"_postman_id":"8c0dae78-fdf5-4998-903c-de7ed269fe34"}],"id":"85137466-2bb9-4dda-b7ec-4146814b035c","description":"<p>API's for organization hierarchy management including Sites and Locations.</p>\n<ul>\n<li><p>Organizations: Can Retrieve an Organization's information</p>\n</li>\n<li><p>Sites: Can Retrieve a Site's information.</p>\n</li>\n<li><p>Locations: Can Create a new Location, Retrieve a Location's information, Update a Location's information, and Delete a Location.</p>\n</li>\n</ul>\n","_postman_id":"85137466-2bb9-4dda-b7ec-4146814b035c","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}}},{"name":"Locations","item":[{"name":"Get Location","id":"16d8a1a2-3f37-4bea-a733-e6896a7ddab1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"","description":"<p>Organization ID</p>\n"},{"key":"X-AMDI-SITE-ID","value":"","description":"<p>Site ID</p>\n"},{"key":"X-AMDI-LOCATION-ID","value":"","description":"<p>Location ID</p>\n","type":"text"},{"key":"X-AMDI-OPERATOR-ID","value":"","description":"<p>Operator ID</p>\n"}],"url":"{{base_url}}/v1/locations/:location_id","description":"<p>Retrieves detailed information about a specific location identified by its unique identifier.</p>\n","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}},"urlObject":{"path":["v1","locations",":location_id"],"host":["{{base_url}}"],"query":[],"variable":[{"id":"196f82c4-9830-4494-b169-881acd4928da","description":{"content":"<p>Location ID</p>\n","type":"text/plain"},"type":"any","value":"<integer>","key":"location_id"}]}},"response":[{"id":"497e5c26-df41-4c4d-b74e-e6549cd0a3f2","name":"Get Location","originalRequest":{"method":"GET","header":[{"key":"X-AMDI-ORG-ID","value":"<integer>","description":"Organization ID"},{"key":"X-AMDI-SITE-ID","value":"<integer>","description":"Site ID"},{"key":"X-AMDI-OPERATOR-ID","value":"<integer>","description":"User ID"}],"url":{"raw":"<API Base URL>/v1/locations/:location_id","host":["<API Base URL>"],"path":["v1","locations",":location_id"],"variable":[{"key":"location_id","value":"<integer>","description":"Location ID"}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"success\",\n    \"response\": {\n        \"location_id\": 1000001,\n        \"org_id\": 1000001,\n        \"site_id\": 1000001,\n        \"location_name\": \"Pharmacy\",\n        \"active\": true\n    }\n}"}],"_postman_id":"16d8a1a2-3f37-4bea-a733-e6896a7ddab1"}],"id":"787e0d04-0b04-4def-8c12-969b98b770d4","description":"<p>Manages Locations for a Site within an Organization. Provides the ability to Create, Read, Update and Delete.</p>\n","_postman_id":"787e0d04-0b04-4def-8c12-969b98b770d4","auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]},"isInherited":true,"source":{"_postman_id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","id":"c2f16e71-e32d-40c9-b94c-0e3100669ff8","name":"AMDI","type":"collection"}}}],"auth":{"type":"oauth2","oauth2":{"basicConfig":[],"advancedConfig":[{"key":"accessTokenUrl","value":"<access-token-url>"},{"key":"grant_type","value":"<grant_type>"},{"key":"authUrl","value":"<auth-url>"},{"key":"clientSecret","value":"{{api_client_secret}}"},{"key":"clientId","value":"{{api_client_id}}"}]}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":[""],"id":"912cfcc4-f363-4881-b4ea-fe60567a3a4b"}},{"listen":"test","script":{"type":"text/javascript","packages":{},"exec":[""],"id":"8f4051dc-a593-4925-aeb3-78ec70346db5"}}],"variable":[{"key":"unit_testing","value":"true"},{"key":"bearer_token","value":""},{"key":"base_device_id","value":""},{"key":"base_activation_code","value":""},{"key":"operating_module_id","value":""},{"key":"org_id","value":""},{"key":"site_id","value":""},{"key":"location_id","value":""},{"key":"operator_id","value":""},{"key":"test_patient_id","value":""},{"key":"patient_id","value":""},{"key":"control_lot_kit_nbr","value":""},{"key":"current_device_id","value":""},{"key":"operator_current_password","value":""},{"key":"operator_new_password","value":""},{"key":"control_positive_kit_nbr","value":""},{"key":"control_negative_kit_nbr","value":""},{"key":"operator_username","value":""},{"key":"operator_password","value":""},{"key":"base_device_sn","value":""},{"key":"base_device_software_version","value":""},{"key":"operating_module_sn","value":""},{"key":"operating_module_port_nbr","value":""},{"key":"patient_number","value":""},{"key":"patient_first_name","value":""},{"key":"patient_last_name","value":""},{"key":"patient_gender","value":""},{"key":"patient_birth_date","value":""},{"key":"control_positive_disc_sn","value":""},{"key":"control_negative_disc_sn","value":""},{"key":"test_disc_sn","value":""},{"key":"test_operator_id","value":""},{"key":"control_lot_id","value":""},{"key":"disc_sn","value":""},{"key":"disc_id","value":""},{"key":"new_operator_username","value":""},{"key":"new_operator_first_name","value":""},{"key":"new_operator_last_name","value":""},{"key":"new_operator_temp_pass","value":""},{"key":"operator_type_id","value":""},{"key":"new_operator_type_id","value":""},{"key":"new_operator_badge_number","value":""},{"key":"new_operator_email","value":""},{"key":"check_operator_username","value":""},{"key":"operator_badge_number","value":""},{"key":"operator_first_name","value":""},{"key":"operator_last_name","value":""},{"key":"operator_email","value":""},{"key":"control_positive_control_lot_id","value":""},{"key":"correct_operator_password","value":""},{"key":"admin_type_id","value":""},{"key":"control_negative_disc_id","value":""},{"key":"optics_file_upload_multipart_last_part","value":""}]}