Guest User

Untitled

a guest
Jan 17th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. /** TEST SCRIPT FOR CONTACT */
  2. -- SELECT * FROM PatientProfile
  3. -- DELETE FROM PatientContacts WHERE PatientContactsId = 362
  4. -- DELETE FROM PatientRelationship WHERE PatientRelationshipId = 10642
  5.  
  6. DECLARE @PatientId VARCHAR(20) = '661';
  7.  
  8. EXEC cus_HS_CW_Insert_Contact @PatientId, 'Emergency', 'Joe Mc Biden', '5556667779';
  9. -- UPDATE PatientContacts SET middle = '' WHERE PatientContactsId = 367
  10.  
  11. SELECT *
  12. FROM PatientProfile
  13. WHERE PatientId = @PatientId
  14.  
  15. SELECT pr.*
  16. FROM PatientRelationship pr
  17. WHERE pr.PatientProfileId = (
  18. SELECT PatientProfileId
  19. FROM PatientProfile
  20. WHERE PatientId = @PatientId
  21. );
  22.  
  23. SELECT pc.*
  24. FROM PatientContacts pc
  25. JOIN PatientRelationship pr ON pr.RelatedPartyId = pc.PatientContactsId
  26. WHERE pr.PatientProfileId = (
  27. SELECT PatientProfileId
  28. FROM PatientProfile
  29. WHERE PatientId = @PatientId
  30. );
Add Comment
Please, Sign In to add comment