-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
FHIR Coverage Resource Added #4164
Conversation
Latest Dec 29
Latest Jan 4 2021
These below alter table statements are required in the upgrade sql |
While Creating the Coverage Resource, the status field is compulsory |
hi @vishnuyar , yes, that's correct, but if the current date is less than the date in the table then the insurance is not yet effective which is not that common in my experience. More common will be a null date since folks add them and often don't enter the effective date. Easiest solution might be to grab the most recent insurance entered, and just talking about primary right now for simplicity and then use it if passes the current date test. It might be nice to add a date to check when calling this function. |
@stephenwaite how will we know if a specific plan has expired |
only definitive is if another ins has been added that has a more recent effective date |
Hi @vishnuyar |
Looking at OpenEmr code, I assumed only Fhir is categorizing each of these
entities as Organization with different types.
For a similar thing in API, probably best to create a single table holding
various Organizations, probably being populated via stored Procedure, nit
even sure if that is a good idea.
…On Thu, Jan 7, 2021, 00:02 Jerry Padgett ***@***.***> wrote:
Hi @vishnuyar <https://github.com/vishnuyar>
I not sure the best way to handle what constitutes a Organization is
inside the FHIR service.
Our API design concept is to extend this type of core database arbitration
from a standard service. The reason for this is that many other current and
future development relies on these types of service. In this case,
Institutional development and upcoming HIE feature will rely on similar
need for Organization.
So now would be the best time to do this as if we bring this PR into
codebase as it is now, i'll have to rewrite.
How can I help you to do this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4164 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2HCSIT4T554UUQIBNG3NDSYSUDPANCNFSM4VXPXGJA>
.
|
It is true we currently don't use Organization per se. However, we have an ongoing project for institutional support where both Organization and Location are important. Since we are now needing this capabilities to support FHIR it has pushed up the timeline on adding these services. |
hi, |
@sjpadgett @bradymiller Based on both of your views, This is the solution i have implemented. Create OrganizationService which is being used by FhirOrganizationService Keeping the unique nature of these organizations Separate API services can be used to write or update these services via API This solution doesn't require any UI changes nor creating a new table. Let me know your views. I am open to making further modifications. UI is not my forte, I will probably need help if the solution requires UI change. |
hi @vishnuyar , the new upgrade script is |
I thought the Coverage Resoure will be included in version 6.0.0 too. |
use Particle\Validator\Validator; | ||
use Particle\Validator\Exception\InvalidValueException; | ||
use OpenEMR\Common\Uuid\UuidRegistry; | ||
use Ramsey\Uuid\Exception\InvalidUuidStringException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alphabetize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed unused statements
* | ||
* @package OpenEMR | ||
* @link http://www.open-emr.org | ||
* @author Vishnu Yarmaneni <vardhanvishnu@gmail.com> |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Regarding the automated testing. I'll bring in a fix for the 8.1 syntax (#4168). It looks like the other fails are because a code change is breaking one test in PHP 7.4/8 testing environments:
|
@@ -353,12 +353,10 @@ public function getOne($uuid) | |||
"limit" => 1 | |||
)); | |||
|
|||
if ($sqlResult) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just checking that sqlResult is always populated with something? (or was this causing issues otherwise?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was the reason PHP7.4 and PHP8.0 were breaking.
Got it from here.
https://stackoverflow.com/questions/59674903/trying-to-access-array-offset-on-value-of-type-bool-in-php-7-4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case, would revert your changes here and do the following for the if:
if (!empty($sqlResult)) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vishnuyar , still need to address this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
|
||
public function getOne($id) | ||
public function getOne($uuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
migrate the old getOne function to getOneById (and change where it is called in the codebase; it is used 1 time in the codebase in receipts_by_method_report.php).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new function getOneById() , changed the same in codebase in receipts_by_method_report.php and InsuranceCompanyRestController.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also used in
interface/billing/sl_eob_process.php
I think everywhere else is covered but i'd search code base to double check me...
src/Services/InsuranceService.php
Outdated
@@ -60,25 +79,116 @@ public function validate($data) | |||
return $validator->validate($data); | |||
} | |||
|
|||
public function getOne($pid, $type) | |||
public function getOne($uuid, $type = 'primary') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above strategy, migrate old getOne() function to getOneByPid() and change accordingly where it is called in the codebase. then you do not need to have hybrid functions that are doing very different things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the function getOneByPid(), made the change in codebase receipts_by_method_report.php and InsuranceRestController.php
} | ||
|
||
public function getAll($pid) | ||
public function getAll($search = array(), $isAndCondition = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note this function is not used in core codebase, so it does not need to support pid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
RestConfig::authorization_check("admin", "super"); | ||
$return = (new FhirCoverageRestController())->getOne($uuid); | ||
RestConfig::apiLog($return); | ||
return $return; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
review complete |
src/Validators/BaseValidator.php
Outdated
@@ -111,8 +111,11 @@ public static function validateId($field, $table, $lookupId, $isUuid = false) | |||
"SELECT $field FROM $table WHERE $field = ?", | |||
array($lookupId) | |||
); | |||
|
|||
return $result[$field] ? true : $validationResult; | |||
if ($result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guessing this had to be changed for php8 issues. would change this if to:
if (!empty($result[$field])) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -35,7 +35,7 @@ public function getAll() | |||
|
|||
public function getOne($iid) | |||
{ | |||
$serviceResult = $this->insuranceCompanyService->getOne($iid); | |||
$serviceResult = $this->insuranceCompanyService->getOneById($iid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rest controllers should not be changed (the rest endpoints will use uuid then)
Just need to ensure all the other placed in codebase that use the service are changed
(grep insuranceCompanyService and change the getOne to getOneById where used outside fhir/rest)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just checked and otherwise looks good in codebase (just need to change this back to getOne() )
And then need to update lines 1479 and 1484 in API_README.md to show use of uuid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, that is a put. agree best thing to do here is to keep as is (changing to uuid for this restcontroller will require a bunch more more). so keep the getOneById call :)
@@ -32,7 +32,7 @@ public function getAll($pid) | |||
|
|||
public function getOne($pid, $type) | |||
{ | |||
$serviceResult = $this->insuranceService->getOne($pid, $type); | |||
$serviceResult = $this->insuranceService->getOneByPid($pid, $type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rest controllers should not be changed (the rest endpoints will use uuid then)
Just need to ensure all the other placed in codebase that use the service are changed
(grep insuranceService and change the getOne to getOneByPid where used outside fhir/rest)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, this is more complicated since the endpoint takes in pid and type. let me look into that to see best strategy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO for me: see above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, lets also keep this as is (getOneByPid). And just need to change one more instance of getOne (to getOneByPid) use in the interface/billing/sl_eob_process.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the functionname in interface/billing/sl_eob_process.php
@@ -44,6 +44,7 @@ Database Result -> Service Component -> FHIR Service Component -> Parse OpenEMR | |||
- [FHIR API Endpoints](FHIR_README.md#fhir-endpoints) | |||
- [Capability Statement](FHIR_README.md#capability-statement) | |||
- [Patient](FHIR_README.md#patient-resource) | |||
- [Coverage](FHIR_README.md#coverage-resource) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
review complete. just some minor things to fix. |
API_README.md
Outdated
@@ -162,6 +163,7 @@ This is a listing of scopes: | |||
- `api:fhir` (user fhir which are the /fhir/ endpoints) | |||
- `user/AllergyIntolerance.read` | |||
- `user/CareTeam.read` | |||
- `user/Coverage.read` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd usually let this go, but since there's another minor change to do, might as well alphabetize (place below Condition) this as well :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hoping that my next PR will have less of these kind of mistakes :)
2 more very minor things to address and then this PR is ready :) |
hi @vishnuyar , Code looks great and bringing in. Thanks for the improvements! -brady |
Fixes #4156
Short description of what this resolves:
FHIR Coverage Resource has been added
Changes proposed in this pull request:
Add Insurance Companies to the FHIR Organization Resources
Add Insurance Companies as Payor Reference in the Coverage FHIR Resource
When Searching for Organizations -- Will check in Both Facilities and Insurance Companies