-
-
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
Added CareTeam Resource #3884
Added CareTeam Resource #3884
Conversation
Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
@@ -2127,5 +2127,36 @@ ALTER TABLE `form_bronchitis` MODIFY `diagnosis3_bronchitis_form` text; | |||
ALTER TABLE `form_bronchitis` MODIFY `diagnosis4_bronchitis_form` text; | |||
#EndIf | |||
|
|||
#IfColumn patient_data care_team |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
sql/5_0_2-to-6_0_0_upgrade.sql
Outdated
ALTER TABLE `patient_data` DROP COLUMN `care_team`; | ||
#EndIf | ||
|
||
#IfMissingColumn patient_data care_team_provider |
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.
and would then place this block before the prior code block
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.
So It should be like
- create care_team_provider
- copy care_team data to care_team_provider
- drop care_team
RIGHT?
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.
yep, that is good
#IfMissingColumn patient_data care_team_facility | ||
ALTER TABLE `patient_data` ADD COLUMN `care_team_facility` int(11) DEFAULT NULL; | ||
#EndIf | ||
|
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.
INSERT INTO `layout_options` (`form_id`,`field_id`,`group_id`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'care_team_provider', '3', 'Care Team (Provider)', 21, 11, 1, 0, 0, '', 1, 1, '', '', '', 0); | ||
#EndIf | ||
|
||
#IfNotRow2D layout_options form_id DEM field_id care_team_facility |
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 if skip a seq so no need for above 2 code blocks. In this if would do following:
- change care_team field_id to care_team_provider
- find the highest seq in the group_id that the care_team_provider field_id is in (also get the group_id)
- Then change the seq in care_team_provider to this max seq + 1
- Then add the care_team_facility entry with max seq + 2 and with the group_id obtained in step 2
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.
Doing above allows addition of new fields even if their group_id's have been changed with customization
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.
Also note that the care_team_provider and care_team_facility will need to support multiselect (likely means need new datatypes that adapted from 11 and 35)
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.
Did you mean user should able to select multiple providers?
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.
yep, for the care team provider and care team facility, should be able to add multiple selections. can see how this is done for the multiselect list datatype which basically just extended the normal select list datatype.
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.
Do we need to create new datatype for multi-select and how will we store multiple id in one 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.
Would make them TEXT columns in database and can check out data_type 36 to see how it stores and collects the items from one field in library/options.inc.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.
but data_type 36 accepts data from list_options
only and we require data from facility
& users
table 🤔
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.
Should I make a util function which gets array of data and converts it into Multiple-Select list and Simple Select List?
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.
if compare the difference between data_type 36 and 1, then will note:
- having
multiple='multiple'
in the select - take the posted select array and convert it to a string with
|
delimiter - store the elements in the database field with the
|
delimiter
So, basically need to duplicate the 11 and 25 date_type into new data_types that support 1 - 3 above
There a 7 or so placed in portal code where care_team needs to be changed to care_team_provider . Can find them with following regex |
hi @yashrajbothra , Code review complete. Couple things to address :) |
Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
Hii @bradymiller , I have Fixed all the multi-select problem. Kindly review |
On fhir testing with
|
hi @yashrajbothra , Just reviewed/tested and posted issues above. Definitely going in a good direction :) |
Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
…team Signed-off-by: Yash Bothra <yashrajbothra786@gmail.com>
Hi @bradymiller, Just pushed some changes. Testing Well :) |
...ce/modules/zend_modules/module/Patientvalidation/src/Patientvalidation/Model/PatientData.php
Outdated
Show resolved
Hide resolved
hi @yashrajbothra , |
SET @group_name = (SELECT group_name FROM layout_options WHERE field_id='care_team_provider' AND form_id='DEM'); | ||
SET @backup_group_name = (SELECT group_name FROM layout_options WHERE field_id='DOB' AND form_id='DEM'); | ||
SET @seq = (SELECT MAX(seq) FROM layout_options WHERE group_name = IFNULL(@group_name,@backup_group_name) AND form_id='DEM'); | ||
INSERT INTO `layout_options` (`form_id`,`field_id`,`group_id`,`title`,`seq`,`data_type`,`uor`,`fld_length`,`max_length`,`list_id`,`titlecols`,`datacols`,`default_value`,`edit_options`,`description`,`fld_rows`) VALUES ('DEM', 'care_team_facility', IFNULL(@group_name,@backup_group_name), 'Care Team (Facility)', @seq+1, 44, 1, 0, 0, '', 1, 1, '', '', '', 0); |
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:
I think i may of given you some outdated logic (group_name instead of group_id in places). If i did, I'll fix that when I test it and bring it in.
hi @yashrajbothra , Bringing this in (couple minor fixes gonna address on a following commit that changes to use group_id in upgrde, static use of mapping uuid, and fix in my crazy mapping uuid sql logic). Thanks for yet another fhir endpoint! -brady |
Short description of what this resolves:
Added Support to CareTeam Resource as per US core Profile
Changes proposed in this pull request: