Apply clinic lab workflow feedback
This commit is contained in:
+43
-49
@@ -21,19 +21,28 @@ enum JobLocation { atClinic, atLab }
|
||||
|
||||
enum JobWorkflowType { arjinat, geleneksel, dijital }
|
||||
|
||||
enum ProstheticFamily { sabit, implant, hareketli, gecici, ozel }
|
||||
enum ProstheticFamily { sabit, hareketli, gecici, ozel }
|
||||
|
||||
enum ProstheticType {
|
||||
sabit,
|
||||
hareketli,
|
||||
gecici,
|
||||
diger,
|
||||
metalPorselen,
|
||||
zirkonyum,
|
||||
implantUstuZirkonyum,
|
||||
gecici,
|
||||
eMax,
|
||||
tamProtez,
|
||||
parsiyel,
|
||||
diger,
|
||||
}
|
||||
|
||||
const visibleProstheticTypes = <ProstheticType>[
|
||||
ProstheticType.sabit,
|
||||
ProstheticType.hareketli,
|
||||
ProstheticType.gecici,
|
||||
ProstheticType.diger,
|
||||
];
|
||||
|
||||
// ── Status ────────────────────────────────────────────────────────────────────
|
||||
|
||||
extension JobStatusExt on JobStatus {
|
||||
@@ -119,6 +128,7 @@ extension JobStepExt on JobStep {
|
||||
};
|
||||
|
||||
bool get isLabOptional => switch (this) {
|
||||
JobStep.dijitalTasarim ||
|
||||
JobStep.modelHazirlik ||
|
||||
JobStep.fotografOnay ||
|
||||
JobStep.kaliteKontrol ||
|
||||
@@ -146,32 +156,38 @@ extension JobWorkflowTypeExt on JobWorkflowType {
|
||||
|
||||
extension ProstheticTypeExt on ProstheticType {
|
||||
String get label => switch (this) {
|
||||
ProstheticType.sabit => 'Sabit',
|
||||
ProstheticType.hareketli => 'Hareketli',
|
||||
ProstheticType.gecici => 'Geçici',
|
||||
ProstheticType.diger => 'Diğer',
|
||||
ProstheticType.metalPorselen => 'Metal Porselen',
|
||||
ProstheticType.zirkonyum => 'Zirkonyum',
|
||||
ProstheticType.implantUstuZirkonyum => 'İmplant Üstü Zirkonyum',
|
||||
ProstheticType.gecici => 'Geçici',
|
||||
ProstheticType.eMax => 'E-Max',
|
||||
ProstheticType.tamProtez => 'Tam Protez',
|
||||
ProstheticType.parsiyel => 'Parsiyel Protez',
|
||||
ProstheticType.diger => 'Diğer',
|
||||
};
|
||||
String get value => switch (this) {
|
||||
ProstheticType.sabit => 'sabit',
|
||||
ProstheticType.hareketli => 'hareketli',
|
||||
ProstheticType.gecici => 'gecici',
|
||||
ProstheticType.diger => 'diger',
|
||||
ProstheticType.metalPorselen => 'metal_porselen',
|
||||
ProstheticType.zirkonyum => 'zirkonyum',
|
||||
ProstheticType.implantUstuZirkonyum => 'implant_ustu_zirkonyum',
|
||||
ProstheticType.gecici => 'gecici',
|
||||
ProstheticType.eMax => 'e_max',
|
||||
ProstheticType.tamProtez => 'tam_protez',
|
||||
ProstheticType.parsiyel => 'parsiyel',
|
||||
ProstheticType.diger => 'diger',
|
||||
};
|
||||
|
||||
ProstheticFamily get family => switch (this) {
|
||||
ProstheticType.sabit ||
|
||||
ProstheticType.metalPorselen ||
|
||||
ProstheticType.zirkonyum ||
|
||||
ProstheticType.implantUstuZirkonyum ||
|
||||
ProstheticType.eMax =>
|
||||
ProstheticFamily.sabit,
|
||||
ProstheticType.implantUstuZirkonyum => ProstheticFamily.implant,
|
||||
ProstheticType.hareketli ||
|
||||
ProstheticType.tamProtez ||
|
||||
ProstheticType.parsiyel =>
|
||||
ProstheticFamily.hareketli,
|
||||
@@ -180,6 +196,19 @@ extension ProstheticTypeExt on ProstheticType {
|
||||
};
|
||||
}
|
||||
|
||||
ProstheticType parseProstheticTypeValue(String value) => switch (value) {
|
||||
'sabit' ||
|
||||
'metal_porselen' ||
|
||||
'zirkonyum' ||
|
||||
'implant_ustu_zirkonyum' ||
|
||||
'e_max' =>
|
||||
ProstheticType.sabit,
|
||||
'hareketli' || 'tam_protez' || 'parsiyel' => ProstheticType.hareketli,
|
||||
'gecici' => ProstheticType.gecici,
|
||||
'diger' => ProstheticType.diger,
|
||||
_ => ProstheticType.diger,
|
||||
};
|
||||
|
||||
// ── Step template ─────────────────────────────────────────────────────────────
|
||||
|
||||
class JobWorkflowPreset {
|
||||
@@ -195,6 +224,7 @@ class JobWorkflowPreset {
|
||||
}
|
||||
|
||||
const optionalLabStepCatalog = <JobStep>[
|
||||
JobStep.dijitalTasarim,
|
||||
JobStep.modelHazirlik,
|
||||
JobStep.fotografOnay,
|
||||
JobStep.kaliteKontrol,
|
||||
@@ -208,6 +238,8 @@ bool isOptionalStepApplicable(
|
||||
required bool provaRequired,
|
||||
}) {
|
||||
switch (step) {
|
||||
case JobStep.dijitalTasarim:
|
||||
return workflowType == JobWorkflowType.dijital;
|
||||
case JobStep.modelHazirlik:
|
||||
return workflowType != JobWorkflowType.dijital &&
|
||||
family != ProstheticFamily.gecici;
|
||||
@@ -243,6 +275,8 @@ List<JobStep> mergeOptionalLabSteps({
|
||||
|
||||
final finalIndex = merged.indexOf(JobStep.cilaBitim);
|
||||
switch (step) {
|
||||
case JobStep.dijitalTasarim:
|
||||
merged.insert(0, step);
|
||||
case JobStep.modelHazirlik:
|
||||
final afterControl = merged.contains(JobStep.olcuKontrol)
|
||||
? merged.indexOf(JobStep.olcuKontrol) + 1
|
||||
@@ -274,48 +308,30 @@ JobWorkflowPreset buildJobWorkflowPreset({
|
||||
steps = switch (family) {
|
||||
ProstheticFamily.sabit => provaRequired
|
||||
? const [
|
||||
JobStep.dijitalTasarim,
|
||||
JobStep.ustYapiProva,
|
||||
JobStep.cilaBitim,
|
||||
]
|
||||
: const [
|
||||
JobStep.dijitalTasarim,
|
||||
JobStep.cilaBitim,
|
||||
],
|
||||
ProstheticFamily.implant => provaRequired
|
||||
? const [
|
||||
JobStep.dijitalTasarim,
|
||||
JobStep.dayanakProva,
|
||||
JobStep.kronProva,
|
||||
JobStep.cilaBitim,
|
||||
]
|
||||
: const [
|
||||
JobStep.dijitalTasarim,
|
||||
JobStep.cilaBitim,
|
||||
],
|
||||
ProstheticFamily.hareketli => provaRequired
|
||||
? const [
|
||||
JobStep.dijitalTasarim,
|
||||
JobStep.mumProva,
|
||||
JobStep.dislerProva,
|
||||
JobStep.cilaBitim,
|
||||
]
|
||||
: const [
|
||||
JobStep.dijitalTasarim,
|
||||
JobStep.cilaBitim,
|
||||
],
|
||||
ProstheticFamily.gecici => const [
|
||||
JobStep.dijitalTasarim,
|
||||
JobStep.cilaBitim,
|
||||
],
|
||||
ProstheticFamily.ozel => provaRequired
|
||||
? const [
|
||||
JobStep.dijitalTasarim,
|
||||
JobStep.altYapiProva,
|
||||
JobStep.cilaBitim,
|
||||
]
|
||||
: const [
|
||||
JobStep.dijitalTasarim,
|
||||
JobStep.cilaBitim,
|
||||
],
|
||||
};
|
||||
@@ -333,17 +349,6 @@ JobWorkflowPreset buildJobWorkflowPreset({
|
||||
JobStep.olcuKontrol,
|
||||
JobStep.cilaBitim,
|
||||
],
|
||||
ProstheticFamily.implant => provaRequired
|
||||
? const [
|
||||
JobStep.olcuKontrol,
|
||||
JobStep.dayanakProva,
|
||||
JobStep.kronProva,
|
||||
JobStep.cilaBitim,
|
||||
]
|
||||
: const [
|
||||
JobStep.olcuKontrol,
|
||||
JobStep.cilaBitim,
|
||||
],
|
||||
ProstheticFamily.hareketli => provaRequired
|
||||
? const [
|
||||
JobStep.olcuKontrol,
|
||||
@@ -579,7 +584,7 @@ class Job {
|
||||
patientCode: j['patient_code'] as String,
|
||||
prostheticId: str(j['prosthetic_id']),
|
||||
prostheticName: prostheticExp?['name'] as String?,
|
||||
prostheticType: _parseProstheticType(j['prosthetic_type'] as String),
|
||||
prostheticType: parseProstheticTypeValue(j['prosthetic_type'] as String),
|
||||
memberCount: (j['member_count'] as num).toInt(),
|
||||
teeth: j['teeth'] is List
|
||||
? (j['teeth'] as List).map((e) => e.toString()).toList()
|
||||
@@ -660,15 +665,4 @@ class Job {
|
||||
final code = (patientExp['patient_code'] as String?)?.trim();
|
||||
return (code == null || code.isEmpty) ? null : code;
|
||||
}
|
||||
|
||||
static ProstheticType _parseProstheticType(String s) => switch (s) {
|
||||
'zirkonyum' => ProstheticType.zirkonyum,
|
||||
'implant_ustu_zirkonyum' => ProstheticType.implantUstuZirkonyum,
|
||||
'gecici' => ProstheticType.gecici,
|
||||
'e_max' => ProstheticType.eMax,
|
||||
'tam_protez' => ProstheticType.tamProtez,
|
||||
'parsiyel' => ProstheticType.parsiyel,
|
||||
'diger' => ProstheticType.diger,
|
||||
_ => ProstheticType.metalPorselen,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user