-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded Medication Resource (#3790)
* Added Support to UUID * Changed addDiagnosis to addCode Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com> * Added Standard Drug Endpoint Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com> * Updated FHIR Medication Endpoints Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com> * Update API Docs Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com> * Added UUID to database.sql Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com> * Fixes Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
- Loading branch information
1 parent
4185fec
commit bf4d7bc
Showing
12 changed files
with
413 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/** | ||
* DrugRestController | ||
* | ||
* @package OpenEMR | ||
* @link http://www.open-emr.org | ||
* @author Yash Bothra <yashrajbothra786gmail.com> | ||
* @copyright Copyright (c) 2020 Yash Bothra <yashrajbothra786gmail.com> | ||
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 | ||
*/ | ||
|
||
namespace OpenEMR\RestControllers; | ||
|
||
use OpenEMR\Services\DrugService; | ||
use OpenEMR\RestControllers\RestControllerHelper; | ||
|
||
class DrugRestController | ||
{ | ||
private $drugService; | ||
|
||
public function __construct() | ||
{ | ||
$this->drugService = new DrugService(); | ||
} | ||
|
||
/** | ||
* Fetches a single drug resource by id. | ||
* @param $uuid- The drug uuid identifier in string format. | ||
*/ | ||
public function getOne($uuid) | ||
{ | ||
$processingResult = $this->drugService->getOne($uuid); | ||
|
||
if (!$processingResult->hasErrors() && count($processingResult->getData()) == 0) { | ||
return RestControllerHelper::handleProcessingResult($processingResult, 404); | ||
} | ||
|
||
return RestControllerHelper::handleProcessingResult($processingResult, 200); | ||
} | ||
|
||
/** | ||
* Returns drug resources which match an optional search criteria. | ||
*/ | ||
public function getAll($search = array()) | ||
{ | ||
$processingResult = $this->drugService->getAll($search); | ||
return RestControllerHelper::handleProcessingResult($processingResult, 200, true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.