Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Upgrading AllergyIntolerance Resource #3736

Merged
merged 24 commits into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes
Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
  • Loading branch information
yashrajbothra committed Jul 23, 2020
commit 2604157fe6ab5f089b83d55849c594765278a53d
4 changes: 2 additions & 2 deletions API_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ Request:
curl -X GET 'http://localhost:8300/apis/api/allergy'
```

#### GET /api/allergy/:uuid
#### GET /api/allergy/:auuid

Request:

Expand Down Expand Up @@ -888,7 +888,7 @@ curl -X PUT 'http://localhost:8300/apis/api/patient/90c196f2-51cc-4655-8858-3a80
}'
```

#### DELETE /api/patient/:pid/allergy/:auuid
#### DELETE /api/patient/:puuid/allergy/:auuid

Request:

Expand Down
16 changes: 8 additions & 8 deletions _rest_routes.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,31 +179,31 @@
RestConfig::authorization_check("patients", "med");
return (new AllergyIntoleranceRestController())->getAll();
},
"GET /api/allergy/:uuid" => function ($uuid) {
"GET /api/allergy/:auuid" => function ($auuid) {
RestConfig::authorization_check("patients", "med");
return (new AllergyIntoleranceRestController())->getOne($uuid);
return (new AllergyIntoleranceRestController())->getOne($auuid);
},
"GET /api/patient/:puuid/allergy" => function ($puuid) {
RestConfig::authorization_check("patients", "med");
return (new AllergyIntoleranceRestController())->getAll(['lists.pid' => $puuid]);
},
"GET /api/patient/:puuid/allergy/:uuid" => function ($puuid, $uuid) {
"GET /api/patient/:puuid/allergy/:auuid" => function ($puuid, $auuid) {
RestConfig::authorization_check("patients", "med");
return (new AllergyIntoleranceRestController())->getAll(['lists.pid' => $puuid, 'lists.id' => $uuid]);
return (new AllergyIntoleranceRestController())->getAll(['lists.pid' => $puuid, 'lists.id' => $auuid]);
},
"POST /api/patient/:puuid/allergy" => function ($puuid) {
RestConfig::authorization_check("patients", "med");
$data = (array) (json_decode(file_get_contents("php://input")));
return (new AllergyIntoleranceRestController())->post($puuid, $data);
},
"PUT /api/patient/:puuid/allergy/:uuid" => function ($puuid, $uuid) {
"PUT /api/patient/:puuid/allergy/:auuid" => function ($puuid, $auuid) {
RestConfig::authorization_check("patients", "med");
$data = (array) (json_decode(file_get_contents("php://input")));
return (new AllergyIntoleranceRestController())->put($puuid, $uuid, $data);
return (new AllergyIntoleranceRestController())->put($puuid, $auuid, $data);
},
"DELETE /api/patient/:puuid/allergy/:uuid" => function ($pid, $aid) {
"DELETE /api/patient/:puuid/allergy/:auuid" => function ($puuid, $auuid) {
RestConfig::authorization_check("patients", "med");
return (new AllergyIntoleranceRestController())->delete($pid, $aid);
return (new AllergyIntoleranceRestController())->delete($puuid, $auuid);
},
"GET /api/patient/:pid/medication" => function ($pid) {
RestConfig::authorization_check("patients", "med");
Expand Down
4 changes: 3 additions & 1 deletion interface/patient_file/summary/add_edit_issue.php
Original file line number Diff line number Diff line change
Expand Up @@ -780,14 +780,16 @@ function divclick(cb, divid) {
?>
</div>
<!-- End of reaction -->
<?php if($thistype == "allergy") { ?>
<!-- Verification Status for Medication Allergy -->
<div class="form-group col-12" id='row_verification'>
<label class="col-form-label" for="form_verification"><?php echo xlt('Verification Status'); ?>:</label>
<?php
echo generate_select_list('form_verification', 'allergyintolerance-verification', $irow['verification'], '', '', '', '');
?>
</div>
<!-- End of Verification Statu -->
<!-- End of Verification Status -->
<?php } ?>
<div class="form-group col-12" id='row_referredby'>
<label class="col-form-label" for="form_referredby"><?php echo xlt('Referred by'); ?>:</label>
<input type='text' name='form_referredby' id='form_referredby' class='form-control' value='<?php echo attr($irow['referredby']) ?>' title='<?php echo xla('Referring physician and practice'); ?>' />
Expand Down
2 changes: 1 addition & 1 deletion sql/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6282,7 +6282,7 @@ INSERT INTO list_options(list_id,option_id,title,seq) VALUES ("us-core-provider-
INSERT INTO list_options(list_id,option_id,title,seq) VALUES ("us-core-provider-specialty", "390200000X", "Student in an Organized Health Care Education/Training Program", 8470);
INSERT INTO list_options(list_id,option_id,title,seq) VALUES ("us-core-provider-specialty", "405300000X", "Prevention Professional", 8480);

-- allergyintolerance-verification [FHIR AllergyIntolerance.verification]
-- AllergyIntolerance Verification Status Codes [FHIR AllergyIntolerance.verification]
yashrajbothra marked this conversation as resolved.
Show resolved Hide resolved
INSERT INTO `list_options` ( `list_id`, `option_id`, `title`, `seq` ) VALUES ('lists' ,'allergyintolerance-verification', 'AllergyIntolerance Verification Status Codes', 1);
INSERT INTO list_options(list_id,option_id,title,seq) VALUES ('allergyintolerance-verification', 'unconfirmed', 'Unconfirmed', 10);
INSERT INTO list_options(list_id,option_id,title,seq) VALUES ('allergyintolerance-verification', 'confirmed', 'Confirmed', 20);
Expand Down
8 changes: 4 additions & 4 deletions src/Services/AllergyIntoleranceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use OpenEMR\Validators\AllergyIntoleranceValidator;
use OpenEMR\Validators\ProcessingResult;

require_once($GLOBALS['fileroot'] . '/custom/code_types.inc.php');
require_once(__DIR__ . '/../../custom/code_types.inc.php');

class AllergyIntoleranceService extends BaseService
{
Expand Down Expand Up @@ -53,14 +53,14 @@ public function getAll($search = array(), $isAndCondition = true)
{
// Validating and Converting Patient UUID to PID
if (isset($search['lists.pid'])) {
$isValidAllergy = $this->allergyIntoleranceValidator->validateId(
$isValidPatient = $this->allergyIntoleranceValidator->validateId(
'uuid',
self::PATIENT_TABLE,
$search['lists.pid'],
true
);
if ($isValidAllergy !== true) {
return $isValidAllergy;
if ($isValidPatient !== true) {
return $isValidPatient;
}
$puuidBytes = UuidRegistry::uuidToBytes($search['lists.pid']);
$search['lists.pid'] = $this->getIdByUuid($puuidBytes, self::PATIENT_TABLE, "pid");
Expand Down