Advertisement
k-joseph

Untitled

Jan 16th, 2014
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <changeSet id="201401081823-TRUNK-4202" author="k-joseph">
  2. <validCheckSum>3:d0da8b0b930623f6c62e2bd02bc2523b</validCheckSum>
  3. <validCheckSum><comment>Changing identifier from person.person_id to user.system_id</comment>3:cccc02519a766bd8fde048cea13d307c</validCheckSum>
  4. <validCheckSum><comment>Changing now() to CURRENT_TIMESTAMP</comment>3:a70d8897d05364a0a4398f2b90542fd4</validCheckSum>
  5. <validCheckSum><comment>Copying user.retired to person.voided so that generated providers for retired users are retired</comment>3:f338c9ea12ce38b0695db335d983b4e1</validCheckSum>
  6. <validCheckSum><comment>Correcting checksum</comment>3:216ab5057dca5471de69124e93953d96</validCheckSum>
  7. <preConditions onFail="MARK_RAN">
  8. <columnExists tableName="orders" columnName="orderer" />
  9. <not><sqlCheck expectedResult="0">select count(*) from orders</sqlCheck></not>
  10. </preConditions>
  11. <comment>Creating provider accounts for all users who have placed
  12. orders for patients and have no associated provider accounts
  13. </comment>
  14. <sql>
  15. INSERT INTO provider( person_id, identifier, creator, date_created, retired, uuid )
  16. SELECT (SELECT orderer FROM orders WHERE orderer NOT IN (SELECT person_id FROM provider)),
  17. CONCAT( "prov: ", SUBSTRING((SELECT uuid FROM person), 5)) , 1, NOW() , false, UUID()
  18. FROM orders
  19. WHERE orderer NOT IN (SELECT person_id FROM provider)
  20. </sql>
  21. </changeSet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement