@csmart/ngc-smart-victim 1.14.31 → 1.14.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -842,7 +842,6 @@ class SmartVictimDetailComponent {
842
842
  victimWeaponUsesControl.setValue(weaponUsesData);
843
843
  const otherWeaponControl = this.victimForm.get('otherWeapon');
844
844
  otherWeaponControl.setValue(otherWeapon);
845
- //this.weaponUsesData = this.editVictim.victimWeaponUses;
846
845
  var drugUseData = [];
847
846
  var otherDrug = "";
848
847
  console.log('load this.editVictim.victimDrugUses');
@@ -979,9 +978,6 @@ class SmartVictimDetailComponent {
979
978
  console.log(this.staffId);
980
979
  console.log('show isIntake');
981
980
  console.log(this.isIntake);
982
- //this.victimDetail.guardianNoPhoneFlag = true;
983
- //this.victimForm.value.guardianNoPhoneFlag = true;
984
- //this.victimForm.get('guardianNoPhoneFlag').setValue(true);
985
981
  //required field
986
982
  const requiredImplementation = { get: function () {
987
983
  if (this._required) {
@@ -1102,26 +1098,16 @@ class SmartVictimDetailComponent {
1102
1098
  });
1103
1099
  }
1104
1100
  radioMinorChange($event) {
1105
- // const guardianLastNameControl = this.victimForm.get('guardianLastName');
1106
- //const guardianFirstNameControl = this.victimForm.get('guardianFirstName');
1107
1101
  if ($event.value === true) {
1108
1102
  this.guardianTabFlag = true;
1109
- // guardianLastNameControl.setValidators(Validators.required);
1110
- // guardianFirstNameControl.setValidators(Validators.required);
1111
- //this.victimForm.value.guardianNoPhoneFlag = true;
1112
1103
  }
1113
1104
  else {
1114
1105
  this.guardianTabFlag = false;
1115
- // guardianLastNameControl.clearValidators();
1116
- // guardianFirstNameControl.clearValidators();
1117
1106
  }
1118
- //guardianLastNameControl.updateValueAndValidity();
1119
- // guardianFirstNameControl.updateValueAndValidity();
1120
1107
  }
1121
1108
  radioAdvocateChange($event) {
1122
1109
  const advocateLastNameControl = this.victimForm.get('advocateLastName');
1123
1110
  const advocateFirstNameControl = this.victimForm.get('advocateFirstName');
1124
- // const advocateNoPhoneControl = this.victimForm.get('advocateNoPhoneFlag');
1125
1111
  if ($event.value === "YS") {
1126
1112
  this.advocateTabFlag = true;
1127
1113
  advocateLastNameControl.setValidators(Validators.required);
@@ -1197,11 +1183,7 @@ class SmartVictimDetailComponent {
1197
1183
  });
1198
1184
  const minorControl = this.victimForm.get('minorFlag');
1199
1185
  minorControl.setValue(true);
1200
- // const guardianLastNameControl = this.victimForm.get('guardianLastName');
1201
- // const guardianFirstNameControl = this.victimForm.get('guardianFirstName');
1202
1186
  this.guardianTabFlag = true;
1203
- // guardianLastNameControl.setValidators(Validators.required);
1204
- // guardianFirstNameControl.setValidators(Validators.required);
1205
1187
  }
1206
1188
  }
1207
1189
  checkOtherWeapon(WeaponUse) {
@@ -1232,23 +1214,23 @@ class SmartVictimDetailComponent {
1232
1214
  saveVictim() {
1233
1215
  //guardian phone logic
1234
1216
  if (!this.victimForm.value.guardianNoPhoneFlag) {
1235
- if (this.victimForm.value.guardianHomePhone) {
1236
- if (this.victimForm.value.guardianHomePhone !== null) {
1237
- if (this.victimForm.value.guardianHomePhone !== "") {
1217
+ if (this.guardianHomePhoneControl.value) {
1218
+ if (this.guardianHomePhoneControl.value !== null) {
1219
+ if (this.guardianHomePhoneControl.value !== "") {
1238
1220
  this.guardianPhoneExistFlag = true;
1239
1221
  }
1240
1222
  }
1241
1223
  }
1242
- if (this.victimForm.value.guardianWorkPhone !== undefined) {
1243
- if (this.victimForm.value.guardianWorkPhone !== null) {
1244
- if (this.victimForm.value.guardianWorkPhone !== "") {
1224
+ if (this.guardianWorkPhoneControl.value !== undefined) {
1225
+ if (this.guardianWorkPhoneControl.value !== null) {
1226
+ if (this.guardianWorkPhoneControl.value !== "") {
1245
1227
  this.guardianPhoneExistFlag = true;
1246
1228
  }
1247
1229
  }
1248
1230
  }
1249
- if (this.victimForm.value.guardianCellPhone) {
1250
- if (this.victimForm.value.guardianCellPhone !== null) {
1251
- if (this.victimForm.value.guardianCellhone !== "") {
1231
+ if (this.guardianCellPhoneControl.value) {
1232
+ if (this.guardianCellPhoneControl.value !== null) {
1233
+ if (this.guardianCellPhoneControl.value !== "") {
1252
1234
  this.guardianPhoneExistFlag = true;
1253
1235
  }
1254
1236
  }
@@ -1270,23 +1252,23 @@ class SmartVictimDetailComponent {
1270
1252
  console.log(this.phoneValidationFlag);
1271
1253
  //advocate phone logic
1272
1254
  if (!this.victimForm.value.advocateNoPhoneFlag) {
1273
- if (this.victimForm.value.advocateHomePhone) {
1274
- if (this.victimForm.value.advocateHomePhone !== null) {
1275
- if (this.victimForm.value.advocateHomePhone !== "") {
1255
+ if (this.advocateHomePhoneControl.value) {
1256
+ if (this.advocateHomePhoneControl.value !== null) {
1257
+ if (this.advocateHomePhoneControl.value !== "") {
1276
1258
  this.advocatePhoneExistFlag = true;
1277
1259
  }
1278
1260
  }
1279
1261
  }
1280
- if (this.victimForm.value.advocateWorkPhone !== undefined) {
1281
- if (this.victimForm.value.advocateWorkPhone !== null) {
1282
- if (this.victimForm.value.advocateWorkPhone !== "") {
1262
+ if (this.advocateWorkPhoneControl.value !== undefined) {
1263
+ if (this.advocateWorkPhoneControl.value !== null) {
1264
+ if (this.advocateWorkPhoneControl.value !== "") {
1283
1265
  this.advocatePhoneExistFlag = true;
1284
1266
  }
1285
1267
  }
1286
1268
  }
1287
- if (this.victimForm.value.advocateCellPhone) {
1288
- if (this.victimForm.value.advocateCellPhone !== null) {
1289
- if (this.victimForm.value.advocateCellhone !== "") {
1269
+ if (this.advocateCellPhoneControl.value) {
1270
+ if (this.advocateCellPhoneControl.value !== null) {
1271
+ if (this.advocateCellPhoneControl.value !== "") {
1290
1272
  this.advocatePhoneExistFlag = true;
1291
1273
  }
1292
1274
  }
@@ -1352,6 +1334,12 @@ class SmartVictimDetailComponent {
1352
1334
  else {
1353
1335
  this.victimForm.value.advocateCellPhone = null;
1354
1336
  }
1337
+ if (this.advocateWorkPhoneControl.value) {
1338
+ this.victimForm.value.advocateWorkPhone = this.advocateWorkPhoneControl.value.replace(/[()\s-]/g, '');
1339
+ }
1340
+ else {
1341
+ this.victimForm.value.advocateWorkPhone = null;
1342
+ }
1355
1343
  if (this.emergencyContactPhoneControl.value) {
1356
1344
  this.victimForm.value.emergencyContactPhone = this.emergencyContactPhoneControl.value.replace(/[()\s-]/g, '');
1357
1345
  }
@@ -1595,8 +1583,6 @@ class SmartVictimDetailComponent {
1595
1583
  this.victimDetail.victimSupports.push(victimSupport);
1596
1584
  });
1597
1585
  this.victimDetail.victimDrugUses = [];
1598
- console.log('this.victimForm.value.victimDrugUses calculate');
1599
- console.log(this.victimForm.value.victimDrugUses);
1600
1586
  this.victimForm.value.victimDrugUses.forEach(element => {
1601
1587
  const victimDrugUse = {};
1602
1588
  victimDrugUse.drugTypeId = element;
@@ -1613,21 +1599,13 @@ class SmartVictimDetailComponent {
1613
1599
  victimDrugUse.modifiedBy = this.staffId;
1614
1600
  victimDrugUse.victimId = this.victimDetail.victimId;
1615
1601
  this.victimDetail.victimDrugUses.push(victimDrugUse);
1616
- console.log('this.victimForm.value.victimDrugUses after');
1617
- console.log(this.victimForm.value.victimDrugUses);
1618
1602
  });
1619
1603
  this.victimForm.value.victimDrugUses.filter(word => (!(word.drugTypeId === null && word.otherDrug === null)));
1620
- console.log('adjust this.victimForm.value.victimDrugUses ');
1621
- console.log(this.victimForm.value.victimDrugUses);
1622
1604
  this.victimDetail.victimWeaponUses = [];
1623
1605
  this.victimForm.value.victimWeaponUses.forEach(element => {
1624
1606
  const victimWeaponUse = {};
1625
1607
  victimWeaponUse.victimId = this.victimDetail.victimId;
1626
1608
  victimWeaponUse.weaponTypeId = element;
1627
- console.log('weapon element');
1628
- console.log(element);
1629
- console.log(this.victimForm.value.otherWeapon);
1630
- console.log(this.victimForm.value.victimWeaponUses);
1631
1609
  if (element == "OTHER") {
1632
1610
  victimWeaponUse.otherWeapon = this.victimForm.value.otherWeapon;
1633
1611
  }