Displaying differences for changeset
 
display as  

calculate303dAssessment.py

@@ -8488,16 +8488,17 @@
             #     CaseTest = Cells(L1, 12).Value & Cells(L1, 16).Value & Cells(L1, 19).Value
             #     limiter = Right(CaseTest, 1)
             #     Select Case CaseTest
+            applied_standard = standard["applied_standard"] if "applied_standard" in standard else ""
             if (
                 standard["parameter"] == "Aluminum(T)"
                 and standard["duration"].lower() == "acute"
             ):  # Case "Aluminumtotal recoverableacute"
                 segmentStd["Al"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(14, 3) = Cells(L1, 14).Value
                 segmentStd["Al"]["Note"] = "Trec"  # StdPackage(14, 9) = "Trec"
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Al"]["Acute"]["SS"] = "X"  # StdPackage(14, 4) = "X"
                     segmentStd["Al"]["Note"] = "{0}{1}".format(
@@ -8510,11 +8511,11 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case "Aluminumtotal recoverablechronic"
                 segmentStd["Al"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(14, 1) = Cells(L1, 14).Value
                 segmentStd["Al"]["Note"] = "Trec"  # StdPackage(14, 9) = "Trec"
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Al"]["Chronic"]["SS"] = "X"  # StdPackage(14, 2) = "X"
                     segmentStd["Al"]["Note"] = "{0}{1}".format(
@@ -8525,13 +8526,14 @@
             elif (
                 standard["parameter"] == "Aluminum"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Aluminumdissolved aqueousacute"
                 segmentStd["Al"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(14, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Al"]["Acute"]["SS"] = "X"  # StdPackage(14, 4) = "X"
                     segmentStd["Al"]["Note"] = "{0}{1}".format(
@@ -8544,10 +8546,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Aluminumacute"
                 segmentStd["Al"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(14, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Al"]["Acute"]["SS"] = "X"  # StdPackage(14, 4) = "X"
                     segmentStd["Al"]["Note"] = "{0}{1}".format(
@@ -8558,13 +8560,14 @@
             elif (
                 standard["parameter"] == "Aluminum"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Aluminumdissolved aqueouschronic"
                 segmentStd["Al"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(14, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Al"]["Chronic"]["SS"] = "X"  # StdPackage(14, 2) = "X"
                     segmentStd["Al"]["Note"] = "{0}{1}".format(
@@ -8575,13 +8578,14 @@
             elif (
                 standard["parameter"] == "Arsenic"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Arsenicdissolved aqueousacute"
                 segmentStd["As"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(15, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["As"]["Acute"]["SS"] = "X"  # StdPackage(15, 4) = "X"
                 # End if
@@ -8591,49 +8595,50 @@
                 or standard["parameter"] == "Arsenic"
             ):  # Case ""Arsenictotal recoverablechronic", "Arsenicdissolved aqueouschronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "As", standard["duration"], notes
+                    applied_standard, "As", standard["duration"], notes
                 )  # Ant = self.Ambiguous(Cells(L1, 14).Value, 3, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["As"]["Acute"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(15, 3) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["As"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(15, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["As"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(15, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["As"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(15, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["As"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(15, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["As"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(15, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["As"]["Note"] = "{0}{1}".format(segmentStd["As"]["Note"], "?") #StdPackage(15, 9) = StdPackage(15, 9) & Cells(L1, 17).Value
             elif (
                 standard["parameter"] == "Cadmium"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and not standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Cadmiumacute"
                 segmentStd["Cd"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(16, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cd"]["Water Supply"][
                         "SS"
@@ -8645,10 +8650,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Cadmiumtotal recoverablechronic"
                 segmentStd["Cd"]["Agriculture"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(16, 7) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cd"]["Agriculture"][
                         "SS"
@@ -8660,10 +8665,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Cadmiumtotal recoverableacute"
                 segmentStd["Cd"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(16, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cd"]["Water Supply"][
                         "SS"
@@ -8673,13 +8678,14 @@
             elif (
                 standard["parameter"] == "Cadmium"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Cadmiumdissolved aqueousacute"
                 segmentStd["Cd"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(16, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cd"]["Acute"]["SS"] = "X"  # StdPackage(16, 4) = "X"
                 # End if
@@ -8687,13 +8693,14 @@
             elif (
                 standard["parameter"] == "Cadmium"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Cadmiumdissolved aqueouschronic"
                 segmentStd["Cd"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(16, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cd"]["Chronic"]["SS"] = "X"  # StdPackage(16, 2) = "X"
                 # End if
@@ -8703,57 +8710,58 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Coppertotal recoverablechronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Cu", standard["duration"], notes
+                    applied_standard, "Cu", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 9, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["Cu"]["Acute"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(17, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["Cu"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(17, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Cu"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(17, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Cu"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(17, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["Cu"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(17, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["Cu"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(17, 1) = Cells(L1, 14).Value
                 # End if
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cu"]["Chronic"]["SS"] = "X"  # StdPackage(17, 2) = "X"
                     segmentStd["Cu"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(17, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["Cu"]["Note"] = "{0}{1}".format(segmentStd["Cu"]["Note"], "?") #StdPackage(17, 9) = StdPackage(17, 9) & Cells(L1, 17).Value
             elif (
                 standard["parameter"] == "Copper"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Copperdissolved aqueousacute"
                 segmentStd["Cu"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(17, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cu"]["Chronic"]["SS"] = "X"  # StdPackage(17, 4) = "X"
                 # End if
@@ -8761,13 +8769,14 @@
             elif (
                 standard["parameter"] == "Copper"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Copperdissolved aqueouschronic"
                 segmentStd["Cu"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(17, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cu"]["Chronic"]["SS"] = "X"  # StdPackage(17, 2) = "X"
                 # End if
@@ -8775,13 +8784,14 @@
             elif (
                 standard["parameter"] == "Chromium III"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Chromium IIIdissolved aqueouschronic"
                 segmentStd["Cr3"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(18, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cr3"]["Chronic"]["SS"] = "X"  # StdPackage(18, 2) = "X"
                 # End if
@@ -8789,13 +8799,14 @@
             elif (
                 standard["parameter"] == "Chromium III"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Chromium IIIdissolved aqueousacute"
                 segmentStd["Cr3"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(18, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cr3"]["Acute"]["SS"] = "X"  # StdPackage(18, 4) = "X"
                 # End if
@@ -8805,10 +8816,10 @@
                 or standard["parameter"] == "Chromium III"
             ):  # Case ""Chromium IIItotal recoverablechronic", "Chromium IIIchronic"
                 segmentStd["Cr3"]["Agriculture"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(18, 7) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cr3"]["Agriculture"][
                         "SS"
@@ -8820,10 +8831,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Chromium IIItotal recoverableacute"
                 segmentStd["Cr3"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(18, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cr3"]["Water Supply"][
                         "SS"
@@ -8833,13 +8844,14 @@
             elif (
                 standard["parameter"] == "Chromium VI"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Chromium VIdissolved aqueouschronic"
                 segmentStd["Cr6"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(19, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cr6"]["Chronic"]["SS"] = "X"  # StdPackage(19, 2) = "X"
                 # End if
@@ -8847,13 +8859,14 @@
             elif (
                 standard["parameter"] == "Chromium VI"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Chromium VIdissolved aqueousacute"
                 segmentStd["Cr6"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(19, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cr6"]["Acute"]["SS"] = "X"  # StdPackage(19, 4) = "X"
                 # End if
@@ -8863,44 +8876,44 @@
                 or standard["parameter"] == "Chromium VI"
             ):  # Case ""Chromium VItotal recoverablechronic", "Chromium VIchronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Cr6", standard["duration"], notes
+                    applied_standard, "Cr6", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 8, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["Cr6"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(19, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["Cr6"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(19, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Cr6"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(19, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Cr6"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(19, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["Cr6"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(19, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["Cr6"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(19, 1) = Cells(L1, 14).Value
                 # End if
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cr6"]["Chronic"]["SS"] = "X"  # StdPackage(19, 2) = "X"
                     segmentStd["Cr6"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(19, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["Cr6"]["Note"] = "{0}{1}".format(segmentStd["Cr6"]["Note"], "?") #StdPackage(19, 9) = StdPackage(19, 9) & Cells(L1, 17).Value
@@ -8909,10 +8922,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Chromium VItotal recoverableacute"
                 segmentStd["Cr6"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(19, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Cr6"]["Water Supply"][
                         "SS"
@@ -8922,13 +8935,14 @@
             elif (
                 standard["parameter"] == "Iron"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Irondissolved aqueouschronic"
                 segmentStd["FeD"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(20, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["FeD"]["Water Supply"][
                         "SS"
@@ -8940,14 +8954,14 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Irontotal recoverablechronic"
                 segmentStd["FeT"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(21, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["FeT"]["Chronic"]["SS"] = "X"  # StdPackage(21, 2) = "X"
                     segmentStd["FeT"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(21, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["FeT"]["Note"] = "{0}{1}".format(segmentStd["FeT"]["Note"], "?") #StdPackage(21, 9) = StdPackage(21, 9) & Cells(L1, 17).Value
@@ -8956,44 +8970,44 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Ironchronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Fe", standard["duration"], notes
+                    applied_standard, "Fe", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 10, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["FeT"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(21, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["FeT"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(21, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["FeT"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(21, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["FeT"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(21, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["FeT"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(21, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["FeT"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(21, 1) = Cells(L1, 14).Value
                 # End if
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["FeT"]["Chronic"]["SS"] = "X"  # StdPackage(21, 2) = "X"
                     segmentStd["FeT"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(21, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["FeT"]["Note"] = "{0}{1}".format(segmentStd["FeT"]["Note"], "?") #StdPackage(21, 9) = StdPackage(21, 9) & Cells(L1, 17).Value
@@ -9002,10 +9016,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Mercuryacute"
                 segmentStd["Hg"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(22, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Hg"]["Water Supply"][
                         "SS"
@@ -9017,10 +9031,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Mercurytotal recoverablechronic"
                 segmentStd["Hg"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(22, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Hg"]["Chronic"]["SS"] = "X"  # StdPackage(22, 2) = "X"
                 # End if
@@ -9030,10 +9044,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Mercurytotalchronic", "Mercurychronic"
                 segmentStd["Hg"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(22, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Hg"]["Chronic"]["SS"] = "X"  # StdPackage(22, 2) = "X"
                 # End if
@@ -9043,49 +9057,50 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Molybdenumtotal recoverablechronic", "Molybdenumchronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Mo", standard["duration"], notes
+                    applied_standard, "Mo", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 14, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["Mo"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(23, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["Mo"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(23, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Mo"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(23, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Mo"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(23, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["Mo"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(23, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["Mo"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(23, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["Mo"]["Note"] = "{0}{1}".format(segmentStd["Mo"]["Note"], "?") #StdPackage(23, 9) = StdPackage(23, 9) & Cells(L1, 17).Value
             elif (
                 standard["parameter"] == "Manganese"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Manganesedissolved aqueousacute"
                 segmentStd["Mn"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(24, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Mn"]["Acute"]["SS"] = "X"  # StdPackage(24, 4) = "X"
                 # End if
@@ -9095,36 +9110,36 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Manganesedissolved aqueouschronic", "Manganesechronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Mn", standard["duration"], notes
+                    applied_standard, "Mn", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 12, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["Mn"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(24, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["Mn"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(24, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Mn"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(24, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Mn"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(24, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["Mn"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(24, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["Mn"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(24, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["Mn"]["Note"] = "{0}{1}".format(segmentStd["Mn"]["Note"], "?") #StdPackage(24, 9) = StdPackage(24, 9) & Cells(L1, 17).Value
@@ -9133,10 +9148,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Manganesetotal recoverablechronic"
                 segmentStd["Mn"]["Agriculture"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(24, 7) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Mn"]["Agriculture"][
                         "SS"
@@ -9146,13 +9161,14 @@
             elif (
                 standard["parameter"] == "Nickel"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Nickeldissolved aqueousacute"
                 segmentStd["Ni"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(25, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Ni"]["Acute"]["SS"] = "X"  # StdPackage(25, 4) = "X"
                 # End if
@@ -9162,57 +9178,58 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Nickeltotal recoverablechronic", "Nickelchronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Ni", standard["duration"], notes
+                    applied_standard, "Ni", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 15, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["Ni"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(25, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["Ni"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(25, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Ni"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(25, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Ni"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(25, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["Ni"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(25, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["Ni"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(25, 1) = Cells(L1, 14).Value
                 # End if
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Ni"]["Chronic"]["SS"] = "X"  # StdPackage(25, 2) = "X"
                     segmentStd["Ni"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(25, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["Ni"]["Note"] = "{0}{1}".format(segmentStd["Ni"]["Note"], "?") #StdPackage(25, 9) = StdPackage(25, 9) & Cells(L1, 17).Value
             elif (
                 standard["parameter"] == "Nickel"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Nickeldissolved aqueouschronic"
                 segmentStd["Ni"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(25, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Ni"]["Chronic"]["SS"] = "X"  # StdPackage(25, 2) = "X"
                 # End if
@@ -9222,10 +9239,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Leadtotal recoverableacute"
                 segmentStd["Pb"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(26, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Pb"]["Water Supply"][
                         "SS"
@@ -9235,13 +9252,14 @@
             elif (
                 standard["parameter"] == "Lead"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Leaddissolved aqueousacute"
                 segmentStd["Pb"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(26, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Pb"]["Acute"]["SS"] = "X"  # StdPackage(26, 4) = "X"
                 # End if
@@ -9251,10 +9269,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Leadtotal recoverablechronic"
                 segmentStd["Pb"]["Agriculture"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(26, 7) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Pb"]["Agriculture"][
                         "SS"
@@ -9266,57 +9284,58 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Leadchronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Pb", standard["duration"], notes
+                    applied_standard, "Pb", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 11, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["Pb"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(26, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["Pb"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(26, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Pb"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(26, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Pb"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(26, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["Pb"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(26, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["Pb"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(26, 1) = Cells(L1, 14).Value
                 # End if
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Pb"]["Chronic"]["SS"] = "X"  # StdPackage(26, 2) = "X"
                     segmentStd["Pb"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(26, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["Pb"]["Note"] = "{0}{1}".format(segmentStd["Pb"]["Note"], "?") #StdPackage(26, 9) = StdPackage(26, 9) & Cells(L1, 17).Value
             elif (
                 standard["parameter"] == "Lead"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Leaddissolved aqueouschronic"
                 segmentStd["Pb"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(26, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Pb"]["Chronic"]["SS"] = "X"  # StdPackage(26, 2) = "X"
                 # End if
@@ -9326,10 +9345,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Seleniumtotal recoverableacute"
                 segmentStd["Se"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(27, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Se"]["Water Supply"][
                         "SS"
@@ -9339,13 +9358,14 @@
             elif (
                 standard["parameter"] == "Selenium"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Seleniumdissolved aqueousacute"
                 segmentStd["Se"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(27, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Se"]["Acute"]["SS"] = "X"  # StdPackage(27, 4) = "X"
                 # End if
@@ -9355,10 +9375,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Seleniumtotal recoverablechronic"
                 segmentStd["Se"]["Agriculture"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(27, 7) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Se"]["Agriculture"][
                         "SS"
@@ -9368,13 +9388,14 @@
             elif (
                 standard["parameter"] == "Selenium"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Seleniumdissolved aqueouschronic"
                 segmentStd["Se"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(27, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Se"]["Chronic"]["SS"] = "X"  # StdPackage(27, 2) = "X"
                 # End if
@@ -9384,57 +9405,58 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Seleniumchronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Se", standard["duration"], notes
+                    applied_standard, "Se", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 16, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["Se"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(27, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["Se"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(27, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Se"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(27, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Se"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(27, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["Se"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(27, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["Se"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(27, 1) = Cells(L1, 14).Value
                 # End if
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Se"]["Chronic"]["SS"] = "X"  # StdPackage(27, 2) = "X"
                     segmentStd["Se"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(27, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["Se"]["Note"] = "{0}{1}".format(segmentStd["Se"]["Note"], "?") #StdPackage(27, 9) = StdPackage(27, 9) & Cells(L1, 17).Value
             elif (
                 standard["parameter"] == "Uranium"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Uraniumdissolved aqueousacute"
                 segmentStd["U"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(28, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["U"]["Acute"]["SS"] = "X"  # StdPackage(28, 4) = "X"
                 # End if
@@ -9444,10 +9466,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Uraniumtotal recoverablechronic"
                 segmentStd["U"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(28, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["U"]["Water Supply"][
                         "SS"
@@ -9457,13 +9479,14 @@
             elif (
                 standard["parameter"] == "Uranium"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Uraniumdissolved aqueouschronic"
                 segmentStd["U"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(28, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["U"]["Chronic"]["SS"] = "X"  # StdPackage(28, 2) = "X"
                 # End if
@@ -9473,44 +9496,44 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Uraniumchronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "U", standard["duration"], notes
+                    applied_standard, "U", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 19, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["U"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(28, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["U"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(28, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["U"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(28, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["U"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(28, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["U"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(28, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["U"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(28, 1) = Cells(L1, 14).Value
                 # End if
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["U"]["Chronic"]["SS"] = "X"  # StdPackage(28, 2) = "X"
                     segmentStd["U"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(28, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["U"]["Note"] = "{0}{1}".format(segmentStd["U"]["Note"], "?") #StdPackage(28, 9) = StdPackage(28, 9) & Cells(L1, 17).Value
@@ -9520,7 +9543,7 @@
             ):  # Case ""Uraniumacute"
                 # place holder not currently used
                 if (
-                    standard["applied_standard"] != "NS"
+                    applied_standard != "NS"
                 ):  # if Cells(L1, 14).Value != "NS":
                     notes.append(
                         "{0} Uranium Acute standard place holder is no longer good.".format(
@@ -9531,13 +9554,14 @@
             elif (
                 standard["parameter"] == "Zinc"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Zincdissolved aqueousacute"
                 segmentStd["Zn"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(29, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Zn"]["Acute"]["SS"] = "X"  # StdPackage(29, 4) = "X"
                 # End if
@@ -9547,57 +9571,58 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Zinctotal recoverablechronic", "Zincchronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Zn", standard["duration"], notes
+                    applied_standard, "Zn", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 20, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["Zn"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(29, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["Zn"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(29, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Zn"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(29, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Zn"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(29, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["Zn"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(29, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["Zn"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(29, 1) = Cells(L1, 14).Value
                 # End if
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Zn"]["Chronic"]["SS"] = "X"  # StdPackage(29, 2) = "X"
                     segmentStd["Zn"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(29, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["Zn"]["Note"] = "{0}{1}".format(segmentStd["Zn"]["Note"], "?") #StdPackage(29, 9) = StdPackage(29, 9) & Cells(L1, 17).Value
             elif (
                 standard["parameter"] == "Zinc"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Zincdissolved aqueouschronic"
                 segmentStd["Zn"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(29, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Zn"]["Chronic"]["SS"] = "X"  # StdPackage(29, 2) = "X"
                 # End if
@@ -9607,10 +9632,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Silvertotal recoverableacute"
                 segmentStd["Ag"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(13, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Ag"]["Water Supply"][
                         "SS"
@@ -9620,13 +9645,14 @@
             elif (
                 standard["parameter"] == "Silver"
                 and standard["duration"].lower() == "acute"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Silverdissolved aqueousacute"
                 segmentStd["Ag"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(13, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Ag"]["Acute"]["SS"] = "X"  # StdPackage(13, 4) = "X"
                 # End if
@@ -9636,10 +9662,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Silvertotal recoverablechronic"
                 segmentStd["Ag"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(13, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Ag"]["Water Supply"][
                         "SS"
@@ -9649,13 +9675,14 @@
             elif (
                 standard["parameter"] == "Silver"
                 and standard["duration"].lower() == "chronic"
+                and "media" in standard
                 and standard["media"].lower() == "dissolved aqueous"
             ):  # Case ""Silverdissolved aqueouschronic"
                 segmentStd["Ag"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(13, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Ag"]["Chronic"]["SS"] = "X"  # StdPackage(13, 2) = "X"
                 # End if
@@ -9665,40 +9692,40 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Silverchronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Ag", standard["duration"], notes
+                    applied_standard, "Ag", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 17, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["Ag"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(13, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["Ag"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(13, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Ag"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(13, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Ag"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(13, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["Ag"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(13, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["Ag"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(13, 1) = Cells(L1, 14).Value
                 # End if
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Ag"]["Chronic"]["SS"] = "X"  # StdPackage(13, 2) = "X"
                 # End if
@@ -9708,10 +9735,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Ammoniachronic"
                 segmentStd["NH3"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(8, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["NH3"]["Chronic"]["SS"] = "X"  # StdPackage(8, 2) = "X"
                 # End if
@@ -9721,10 +9748,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Ammoniaacute"
                 segmentStd["NH3"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(8, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["NH3"]["Acute"]["SS"] = "X"  # StdPackage(8, 4) = "X"
                 # End if
@@ -9734,36 +9761,36 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Nitrateacute"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "NO3", standard["duration"], notes
+                    applied_standard, "NO3", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 25, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["NO3"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(10, 1) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["NO3"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(10, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["NO3"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(10, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["NO3"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(10, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["NO3"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(10, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["NO3"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(10, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["NO3"]["Note"] = "{0}{1}".format(segmentStd["NO3"]["Note"], "?") #StdPackage(10, 9) = StdPackage(10, 9) & Cells(L1, 17).Value
@@ -9772,10 +9799,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Sulfatechronic"
                 segmentStd["SO4"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(12, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["SO4"]["Water Supply"][
                         "SS"
@@ -9787,10 +9814,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""D.O. (mg/L)chronic"
                 segmentStd["D.O."]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(5, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["D.O."]["Acute"]["SS"] = "X"  # StdPackage(5, 4) = "X"
                 # End if
@@ -9801,7 +9828,7 @@
             ):  # Case ""D.O. (mg/L)acute"
                 # place holder not currently used
                 if (
-                    standard["applied_standard"] != "NS"
+                    applied_standard != "NS"
                 ):  # if Cells(L1, 14).Value != "NS":
                     notes.append(
                         "{0} D.O. (mg/L) Acute standard place holder is no longer good.".format(
@@ -9815,10 +9842,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""D.O. (spawning)chronic"
                 segmentStd["D.O."]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(5, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["D.O."]["Acute"]["SS"] = "X"  # StdPackage(5, 4) = "X"
                 # End if
@@ -9828,10 +9855,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Phosphoruschronic"
                 segmentStd["TP"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(30, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["TP"]["Chronic"]["SS"] = "X"  # StdPackage(30, 2) = "X"
                 # End if
@@ -9843,17 +9870,17 @@
             ):  # Case ""pHacute"
                 # NOTE: pH is being forced into the "Chronic" standard location despite classification in the database as an acute standard, per cdphe (https://alm.engr.colostate.edu/cb/issue/71944), tcw
                 if (
-                    "-" in standard["applied_standard"]
+                    "-" in applied_standard
                 ):  # most pH standards are like "6.5 - 9.0" but some are words like "varies" or "ambient", tcw
                     pH_left, pH_right = [
                         float(x.strip())
-                        for x in standard["applied_standard"].split("-")
+                        for x in applied_standard.split("-")
                     ]
                     segmentStd["pH min"]["Chronic"][
                         "Standard"
                     ] = pH_left  # StdPackage(6, 3) = Left(Cells(L1, 14).Value, X - 1)
                     if (
-                        standard["approach"] == "site-specific"
+                        "approach" in standard and standard["approach"] == "site-specific"
                     ):  # if Cells(L1, 13).Value = "site-specific":
                         segmentStd["pH min"]["Chronic"][
                             "SS"
@@ -9863,7 +9890,7 @@
                         "Standard"
                     ] = pH_right  # StdPackage(7, 3) = Mid(Cells(L1, 14).Value, X + 1, 5)
                     if (
-                        standard["approach"] == "site-specific"
+                        "approach" in standard and standard["approach"] == "site-specific"
                     ):  # if Cells(L1, 13).Value = "site-specific":
                         segmentStd["pH max"]["Chronic"][
                             "SS"
@@ -9882,16 +9909,16 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Sulfidechronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "S-", standard["duration"], notes
+                    applied_standard, "S-", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 27, limiter)
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["S-"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(31, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["S-"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(31, 5) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["S-"]["Note"] = "{0}{1}".format(segmentStd["S-"]["Note"], "?") #StdPackage(31, 9) = StdPackage(31, 9) & Cells(L1, 17).Value
@@ -9902,28 +9929,28 @@
                 segmentStd["E. Coli"][
                     "Note"
                 ] = "Rec. standard of {0} is in place.".format(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(32, 9) = "Rec. standard of " & Cells(L1, 14).Value & " is in place."
             elif (
                 standard["parameter"] == "Cyanide"
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Cyanideacute"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Cyanide", standard["duration"], notes
+                    applied_standard, "Cyanide", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 23, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["Cyanide"]["Acute"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(33, 3) = Cells(L1, 14).Value #redirect becuse chroinc and Ant only looks for TVS
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Cyanide"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(33, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Cyanide"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(33, 5) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["Cyanide"]["Note"] = "{0}{1}".format(segmentStd["Cyanide"]["Note"], "?") #StdPackage(33, 9) = StdPackage(33, 9) & Cells(L1, 17).Value
@@ -9939,13 +9966,13 @@
                     segmentStd["Chlor. A"][
                         "Note"
                     ] = "Footnote: {0} ;Rec. standard of {1} is in place.".format(
-                        segmentStd["Chlor. A"]["Note"], standard["applied_standard"]
+                        segmentStd["Chlor. A"]["Note"], applied_standard
                     )  # StdPackage(34, 9) = "Footnote: " & Cells(L1, 10).Value & " ;Rec. standard of " & Cells(L1, 14).Value & " is in place."
                 else:
                     segmentStd["Chlor. A"][
                         "Note"
                     ] = "Rec. standard of {0} is in place.".format(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(34, 9) = "Rec. standard of " & Cells(L1, 14).Value & " is in place."
                 # End if
                 # if Cells(L1, 13).Value = "site-specific":
@@ -9957,10 +9984,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Chloridechronic"
                 segmentStd["Chloride"]["Water Supply"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(36, 5) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Chloride"]["Water Supply"][
                         "SS"
@@ -9972,10 +9999,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Chlorinechronic"
                 segmentStd["Chlorine"]["Chronic"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(35, 1) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Chlorine"]["Chronic"][
                         "SS"
@@ -9987,10 +10014,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Chlorineacute"
                 segmentStd["Chlorine"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(35, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Chlorine"]["Acute"][
                         "SS"
@@ -10002,10 +10029,10 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Boronchronic"
                 segmentStd["Boron"]["Agriculture"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(37, 7) = (Cells(L1, 14).Value * 1000)
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Boron"]["Agriculture"][
                         "SS"
@@ -10018,7 +10045,7 @@
             ):  # Case ""Berylliumchronic"
                 # place holder
                 if (
-                    standard["applied_standard"] != "NS"
+                    applied_standard != "NS"
                 ):  # if Cells(L1, 14).Value != "NS":
                     notes.append(
                         "{0} Beryllium Chronic standard place holder is no longer good.".format(
@@ -10032,7 +10059,7 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Berylliumacute"
                 if (
-                    standard["applied_standard"] != "NS"
+                    applied_standard != "NS"
                 ):  # if Cells(L1, 14).Value != "NS":
                     notes.append(
                         "{0} Beryllium Acute standard place holder is no longer good.".format(
@@ -10047,16 +10074,16 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Berylliumtotal recoverablechronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "Be", standard["duration"], notes
+                    applied_standard, "Be", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 5, limiter)
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["Be"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(38, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["Be"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(38, 5) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["Be"]["Note"] = "{0}{1}".format(segmentStd["Be"]["Note"], "?") #StdPackage(38, 9) = StdPackage(38, 9) & Cells(L1, 17).Value
@@ -10065,10 +10092,10 @@
                 and standard["duration"].lower() == "acute"
             ):  # Case ""Berylliumtotal recoverableacute"
                 segmentStd["Be"]["Acute"]["Standard"] = self.makeFloat(
-                    standard["applied_standard"]
+                    applied_standard
                 )  # StdPackage(38, 3) = Cells(L1, 14).Value
                 if (
-                    standard["approach"] == "site-specific"
+                    "approach" in standard and standard["approach"] == "site-specific"
                 ):  # if Cells(L1, 13).Value = "site-specific":
                     segmentStd["Be"]["Acute"]["SS"] = "X"  # StdPackage(38, 4) = "X"
                 # End if
@@ -10081,36 +10108,36 @@
                 and standard["duration"].lower() == "chronic"
             ):  # Case ""Nitritechronic"
                 resultKey, notes = self.Ambiguous(
-                    standard["applied_standard"], "NO2", standard["duration"], notes
+                    applied_standard, "NO2", standard["duration"], notes
                 )  # Ant = Ambiguous(Cells(L1, 14).Value, 26, limiter)
                 if resultKey and resultKey.lower() == "acute":
                     segmentStd["NO2"]["Acute"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(9, 3) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "chronic":
                     segmentStd["NO2"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(9, 1) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "agriculture":
                     segmentStd["NO2"]["Agriculture"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(9, 7) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water supply":
                     segmentStd["NO2"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(9, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "water + fish":
                     segmentStd["NO2"]["Water Supply"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(9, 5) = Cells(L1, 14).Value
                 # End if
                 if resultKey and resultKey.lower() == "fish ingestion":
                     segmentStd["NO2"]["Chronic"]["Standard"] = self.makeFloat(
-                        standard["applied_standard"]
+                        applied_standard
                     )  # StdPackage(9, 1) = Cells(L1, 14).Value
                 # End if
                 # segmentStd["NO2"]["Note"] = "{0}{1}".format(segmentStd["NO2"]["Note"], "?") #StdPackage(9, 9) = StdPackage(9, 9) & Cells(L1, 17).Value
@@ -10120,10 +10147,10 @@
                 # X = MsgBox("I can not currently handle the standard for " & CaseTest & ".  Please note this so we can update the template.", vbOKOnly)
                 # ErrorTrap = ErrorTrap & "Error: " & CaseTest & " "
                 notes.append(
-                    "{0}: I can not currently handle the standard for {1} {2}.  Please note this so we can update the template.".format(
+                    "{0}: This tool can not currently handle the standard for {1} {2}.  Please note this so we can update the template.".format(
                         datetime.datetime.now(),
                         standard["parameter"],
-                        standard["applied_standard"],
+                        applied_standard,
                     )
                 )
             # End Select

config.yml

@@ -10,7 +10,7 @@
 # The current version of your application.  This will be advertised
 # through your REST API, and should take the form
 # "<major_version>.<minor_version>.<patch>".
-version: 0.14.0
+version: 0.14.1
 
 # The kind of application.  Currently eRAMS supports two kinds of applications, `system` and `app`.
 # System apps have pre-configured installation and configurations, while all `app` applications are

services.py

@@ -2185,7 +2185,7 @@
                 wbids.add(auid_wbid)
 
         # Call service that only takes wbids and returns only the standards
-        url = "http://csip.engr.colostate.edu:8088/csip-wrap/d/water/standards_wbid/1.3"
+        url = "http://csip.engr.colostate.edu:8088/csip-wrap/d/water/standards_wbid/1.4"
         c = csip.utils.Client(url=url)
         c.add_data("wbids", list(wbids))
         resp = c.execute(url)

static/package.json

@@ -1,6 +1,6 @@
 {
   "name": "er2_303d_assess",
-  "version": "0.14.0",
+  "version": "0.14.1",
   "target": "web",
   "module": "index.js",
   "license": "MIT",