diff --git a/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/table_mapper/concrete/com_prefc_med_equpment_mapper.py b/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/table_mapper/concrete/com_prefc_med_equpment_mapper.py index 193fa0a1..4d345900 100644 --- a/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/table_mapper/concrete/com_prefc_med_equpment_mapper.py +++ b/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/table_mapper/concrete/com_prefc_med_equpment_mapper.py @@ -89,20 +89,17 @@ class ComPrefcMedEqupmentMapper(UltmarcTableMapper): return def __make_upsert_query(self): - # 修正のレコードだった場合はNULLに変換する - if self.record.bed_num == '@': - self.query_parameter['bed_num'] = None - # レコードの存在確認 record_count = self.db.execute_select(self.RECORD_EXISTS_QUERY, self.query_parameter) - # 存在しない場合はInsert if record_count[0]['count_num'] == 0: return self.INSERT_QUERY # 存在する場合はUpdate # 病床数が空の場合は更新しない - if self.record.is_bed_num_not_empty: + if self.record.bed_num is not None: + if self.record.bed_num == '@': + self.query_parameter['bed_num'] = None return self.UPDATE_QUERY else: return None diff --git a/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/tables/com_prefc_med_dis_treat.py b/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/tables/com_prefc_med_dis_treat.py index 5185e84a..979e40a9 100644 --- a/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/tables/com_prefc_med_dis_treat.py +++ b/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/tables/com_prefc_med_dis_treat.py @@ -7,7 +7,7 @@ class ComPrefcMedDisTreat(UltmarcTable): dcfhp_code: str # DCFコード(施設コード) dcfhp_yobi: str # DCFコード(予備) treatment_code: str # 疾患治療コード - pre_num: str # 前年件数 + pre_num: str # 前年比 adddel_div: str # 追加削除区分 maint_flag: str # 修正区分 @@ -23,7 +23,7 @@ class ComPrefcMedDisTreat(UltmarcTable): self.adddel_div = record[6] self.pre_num = record[9] - # Update判断フラグ。前年件数が空の場合は更新しない。 + # Update判断フラグ。数値が空の場合は更新しない。 self.is_pre_num_not_empty = True # smallint型のカラム値は、空文字で渡ってきた場合はNULLに変換する diff --git a/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/tables/com_prefc_med_equpment.py b/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/tables/com_prefc_med_equpment.py index 0e2e4a44..491a0a3f 100644 --- a/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/tables/com_prefc_med_equpment.py +++ b/ecs/jskult-batch-daily/src/batch/ultmarc/utmp_tables/tables/com_prefc_med_equpment.py @@ -23,12 +23,8 @@ class ComPrefcMedEqupment(UltmarcTable): self.adddel_div = record[6] self.bed_num = record[9] - # Update判断フラグ。病床数が空の場合は更新しない。 - self.is_bed_num_not_empty = True - # smallint型のカラム値は、空文字で渡ってきた場合はNULLに変換する self.bed_num = self.bed_num if len(self.bed_num) > 0 else None - self.is_bed_num_not_empty = self.bed_num is not None # DCFDSF施設コード self.dcfdsf_inst_code = ''.join([self.dcfhp_id, self.dcfhp_code, self.dcfhp_yobi]) diff --git a/ecs/jskult-batch-daily/tests/batch/ultmarc/utmp_tables/table_mapper/com_prefc_med_equpment/com_prefc_med_equpment_insert.csv b/ecs/jskult-batch-daily/tests/batch/ultmarc/utmp_tables/table_mapper/com_prefc_med_equpment/com_prefc_med_equpment_insert.csv index 83362ab7..b5882b97 100644 --- a/ecs/jskult-batch-daily/tests/batch/ultmarc/utmp_tables/table_mapper/com_prefc_med_equpment/com_prefc_med_equpment_insert.csv +++ b/ecs/jskult-batch-daily/tests/batch/ultmarc/utmp_tables/table_mapper/com_prefc_med_equpment/com_prefc_med_equpment_insert.csv @@ -3,4 +3,4 @@ "133","00","9901649","","A","009","2","20141113","20141114","3" "133","00","9901679","","A","015","2","20141113","20141114","" "133","00","9904439","","A","006","2","20141113","20141114","" -"133","00","9929798","","A","010","2","20141113","20141114","@" +"133","00","9929798","","A","010","2","20141113","20141114",""