|
53 | 53 | import org.labkey.test.util.LogMethod; |
54 | 54 | import org.labkey.test.util.PortalHelper; |
55 | 55 | import org.labkey.test.util.PostgresOnlyTest; |
| 56 | +import org.labkey.test.util.ehr.EHRClientAPIHelper; |
56 | 57 | import org.labkey.test.util.ext4cmp.Ext4FieldRef; |
57 | 58 | import org.labkey.test.util.ext4cmp.Ext4GridRef; |
58 | 59 | import org.openqa.selenium.Keys; |
@@ -98,6 +99,10 @@ public class NIRC_EHRTest extends AbstractGenericEHRTest implements PostgresOnly |
98 | 99 | private static final String deadAnimalId = "D5454"; |
99 | 100 | private static final String departedAnimalId = "H6767"; |
100 | 101 | private static final String aliveAnimalId = "A4545"; |
| 102 | + |
| 103 | + private String[] weightFields = {"Id", "date", "enddate", "project", "weight", FIELD_QCSTATELABEL, FIELD_OBJECTID, FIELD_LSID, "_recordid", "performedby"}; |
| 104 | + private Object[] weightData1 = {getExpectedAnimalIDCasing("TESTSUBJECT1"), EHRClientAPIHelper.DATE_SUBSTITUTION, null, null, "12", EHRQCState.IN_PROGRESS.label, null, null, "_recordID", 1004}; |
| 105 | + |
101 | 106 | DateTimeFormatter _dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
102 | 107 |
|
103 | 108 | @BeforeClass |
@@ -455,6 +460,18 @@ protected void createTestSubjects() throws Exception |
455 | 460 | primeCaches(); |
456 | 461 | } |
457 | 462 |
|
| 463 | + @Override |
| 464 | + protected String[] getWeightFields() |
| 465 | + { |
| 466 | + return weightFields; |
| 467 | + } |
| 468 | + |
| 469 | + @Override |
| 470 | + protected Object[] getWeightData1() |
| 471 | + { |
| 472 | + return weightData1; |
| 473 | + } |
| 474 | + |
458 | 475 | @Test |
459 | 476 | public void testArrivalForm() |
460 | 477 | { |
@@ -718,35 +735,35 @@ public void createSubjectsForDeathForm() throws IOException, CommandException |
718 | 735 | goToSchemaBrowser(); |
719 | 736 | log("Creating animals"); |
720 | 737 | getApiHelper().doSaveRows(DATA_ADMIN.getEmail(), getApiHelper().prepareInsertCommand("study", "birth", "lsid", |
721 | | - new String[]{"Id", "Date", "gender", "QCStateLabel"}, |
| 738 | + new String[]{"Id", "Date", "gender", "QCStateLabel", "performedby"}, |
722 | 739 | new Object[][]{ |
723 | | - {aliveAnimalId, LocalDateTime.now().minusDays(30), "f", "Completed"}, |
724 | | - {deadAnimalId, LocalDateTime.now().minusDays(30), "m", "Completed"}, |
725 | | - {departedAnimalId, LocalDateTime.now().minusDays(30), "m", "Completed"}, |
| 740 | + {aliveAnimalId, LocalDateTime.now().minusDays(30), "f", "Completed", 1004}, |
| 741 | + {deadAnimalId, LocalDateTime.now().minusDays(30), "m", "Completed", 1004}, |
| 742 | + {departedAnimalId, LocalDateTime.now().minusDays(30), "m", "Completed", 1004}, |
726 | 743 | } |
727 | 744 | ), getExtraContext()); |
728 | 745 |
|
729 | 746 | log("Inserting rows in assignments, protocolAssignment and housing"); |
730 | 747 | InsertRowsCommand protocol = new InsertRowsCommand("study", "protocolAssignment"); |
731 | | - protocol.addRow(Map.of("Id", aliveAnimalId, "date", LocalDateTime.now().minusDays(10), "protocol", "protocol101", "QCStateLabel", "Completed")); |
| 748 | + protocol.addRow(Map.of("Id", aliveAnimalId, "date", LocalDateTime.now().minusDays(10), "protocol", "protocol101", "QCStateLabel", "Completed", "performedby", 1004)); |
732 | 749 | protocol.execute(getApiHelper().getConnection(), getContainerPath()); |
733 | 750 |
|
734 | 751 | InsertRowsCommand project = new InsertRowsCommand("study", "assignment"); |
735 | | - project.addRow(Map.of("Id", aliveAnimalId, "date", LocalDateTime.now().minusDays(10), "project", "640991", "QCStateLabel", "Completed")); |
| 752 | + project.addRow(Map.of("Id", aliveAnimalId, "date", LocalDateTime.now().minusDays(10), "project", "640991", "QCStateLabel", "Completed", "performedby", 1004)); |
736 | 753 | project.execute(getApiHelper().getConnection(), getContainerPath()); |
737 | 754 |
|
738 | 755 | InsertRowsCommand housing = new InsertRowsCommand("study", "housing"); |
739 | | - housing.addRow(Map.of("Id", aliveAnimalId, "date", LocalDateTime.now().minusDays(10), "cage", "C4", "QCStateLabel", "Completed")); |
| 756 | + housing.addRow(Map.of("Id", aliveAnimalId, "date", LocalDateTime.now().minusDays(10), "cage", "C4", "QCStateLabel", "Completed", "performedby", 1004)); |
740 | 757 | housing.execute(getApiHelper().getConnection(), getContainerPath()); |
741 | 758 |
|
742 | 759 | log("Marking an animal dead"); |
743 | 760 | InsertRowsCommand deaths = new InsertRowsCommand("study", "deaths"); |
744 | | - deaths.addRow(Map.of("Id", deadAnimalId, "date", LocalDateTime.now().minusDays(10), "reason", "4")); |
| 761 | + deaths.addRow(Map.of("Id", deadAnimalId, "date", LocalDateTime.now().minusDays(10), "reason", "4", "performedby", 1004)); |
745 | 762 | deaths.execute(getApiHelper().getConnection(), getContainerPath()); |
746 | 763 |
|
747 | 764 | log("Marking an animal departed"); |
748 | 765 | InsertRowsCommand departure = new InsertRowsCommand("study", "departure"); |
749 | | - departure.addRow(Map.of("Id", departedAnimalId, "date", LocalDateTime.now().minusDays(1), "destination", "Oregon NPRC")); |
| 766 | + departure.addRow(Map.of("Id", departedAnimalId, "date", LocalDateTime.now().minusDays(1), "destination", "Oregon NPRC", "performedby", 1004)); |
750 | 767 | departure.execute(getApiHelper().getConnection(), getContainerPath()); |
751 | 768 | } |
752 | 769 |
|
|
0 commit comments