Closed lawrenceadams closed 4 weeks ago
Fair point - I considered this but thought we could get away without creating an extra model, but it's probably more elegant/scalable doing so
I can experiment with this! Will see if the hashing approach is neater
Thanks! I'm leaning towards creating the extra model either way because I like the idea of a unidirectional flow from stg-->int-->mart models. (In reality it might not be possible/practical to do this in all cases, but would like to give it a shot 😃 )
Agree! Best to keep it uniform
@katy-sadowski I think that's all done now! Happy to pick apart further - we're breaking fresh ground!
P.S. I hope the presentation went well!
This PR refactors the existing location model to have a valid PK to allow referencing from the
patient
andcare_site
tables. Previously thelocation
table was orphaned and had duplicate entries.The new referencing works by using a variation of address and city as a natural key to join on from other models.
I have some ongoing thoughts/issues:
care_site_types
are0
and I think we can do better! Perhaps we can use some simple heuristics like presence ofPCP
to set this as38004247 | Ambulatory Primary Care Clinic / Center|
, but likely too much for this PR/for now!location_source_value
back to being NULL - this should probably be a concatenation of the available fieldsThere may be a far slicker approach to this but this is the best I can see for now! Happy to hear other's thoughts