oddb2xml 2.4.5 → 2.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/lib/oddb2xml/builder.rb +13 -3
- data/lib/oddb2xml/extractor.rb +1 -0
- data/lib/oddb2xml/version.rb +1 -1
- data/oddb2xml.xsd +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 448b5c708931ad04ad83dc39b7faaaca6103102e
|
4
|
+
data.tar.gz: cdba955c266fb2039cdb2ae7d06e94593e61ff16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 384d55410772fbd9f675162865ca257f0f2422aaed8a29b255ee190840b79eddc600382628f584a136b4600e047a46d88fd80d1547fdbee7821b04c4e0f7c09f
|
7
|
+
data.tar.gz: 8da57d452ec882381cc551044610e0eaea28cd7697d48f9888a07370946f0695c4e251d24d8b33319a3024f57d40aba63bfe8da5e8e5cf091522d049cda733ad
|
data/History.txt
CHANGED
data/lib/oddb2xml/builder.rb
CHANGED
@@ -798,12 +798,14 @@ module Oddb2xml
|
|
798
798
|
Oddb2xml.log "build_article #{idx} of #{@articles.size} articles" if idx % 500 == 0
|
799
799
|
item = @items[obj[:ean]]
|
800
800
|
pac,no8 = nil,obj[:ean].to_s[4..11] # BAG-XML(SL/LS)
|
801
|
-
|
801
|
+
pack_info = nil
|
802
802
|
pack_info = @packs[no8.intern] if no8 # info from Packungen.xlsx from swissmedic_info
|
803
803
|
ppac = nil # Packungen
|
804
804
|
ean = obj[:ean]
|
805
805
|
next if pack_info and /Tierarzneimittel/.match(pack_info[:list_code])
|
806
806
|
next if obj[:desc_de] and /ad us vet/i.match(obj[:desc_de])
|
807
|
+
next if obj[:desc_de] and obj[:desc_de].length < 3
|
808
|
+
next if obj[:desc_fr] and obj[:desc_fr].length < 3
|
807
809
|
pharma_code = obj[:pharmacode]
|
808
810
|
ean = 0 if sprintf('%013d', ean).match(/^000000/)
|
809
811
|
if obj[:seq]
|
@@ -822,7 +824,15 @@ module Oddb2xml
|
|
822
824
|
xml.ART('DT' => obj[:last_change] ? obj[:last_change] : '') do
|
823
825
|
nbr_records += 1
|
824
826
|
xml.REF_DATA (obj[:refdata] || @migel[pharma_code]) ? '1' : '0'
|
825
|
-
|
827
|
+
if obj[:pharmacode]
|
828
|
+
xml.PHAR sprintf('%07d', obj[:pharmacode])
|
829
|
+
elsif ean > 0
|
830
|
+
xml.PHAR ean
|
831
|
+
else
|
832
|
+
@@counter_pseudo_ean ||= 0
|
833
|
+
@@counter_pseudo_ean += 1
|
834
|
+
xml.PHAR sprintf('9999%07d', @@counter_pseudo_ean) # here we must add a pharmacode or validating will fail
|
835
|
+
end
|
826
836
|
#xml.GRPCD
|
827
837
|
#xml.CDS01
|
828
838
|
#xml.CDS02
|
@@ -923,7 +933,7 @@ module Oddb2xml
|
|
923
933
|
xml.BC /^9999|^0000|^0$/.match(ean.to_s) ? 0 : sprintf('%013d', ean)
|
924
934
|
xml.BCSTAT 'A' # P is alternative
|
925
935
|
#xml.PHAR2
|
926
|
-
} if ean
|
936
|
+
} if ean
|
927
937
|
#xml.ARTCH {
|
928
938
|
#xml.PHAR2
|
929
939
|
#xml.CHTYPE
|
data/lib/oddb2xml/extractor.rb
CHANGED
@@ -167,6 +167,7 @@ module Oddb2xml
|
|
167
167
|
pts = pac.PointLimitations.PointLimitation.first # only first points
|
168
168
|
item[:packages][ean][:limitation_points] = pts ? pts.Points : ''
|
169
169
|
data[ean] = item
|
170
|
+
puts item if /NaCl Bichsel/.match(item[:name_de]) && ean == 7680298002271
|
170
171
|
end
|
171
172
|
end
|
172
173
|
data
|
data/lib/oddb2xml/version.rb
CHANGED
data/oddb2xml.xsd
CHANGED
@@ -135,7 +135,7 @@
|
|
135
135
|
</xs:restriction>
|
136
136
|
</xs:simpleType>
|
137
137
|
</xs:element>
|
138
|
-
<xs:element ref="ns1:PHAR"/>
|
138
|
+
<xs:element minOccurs="0" maxOccurs="1" ref="ns1:PHAR"/>
|
139
139
|
<xs:element minOccurs="0" ref="ns1:SMCAT"/>
|
140
140
|
<xs:element minOccurs="0" name="GEN_PRODUCTION" type="xs:string" />
|
141
141
|
<xs:element minOccurs="0" name="INSULIN_CATEGORY" type="xs:string" />
|