@@ -40,38 +40,19 @@ function extractClinVarData() {
4040 vcv_eval_date : "" ,
4141 row : [ ]
4242 } ;
43-
44- var variantBox = document . evaluate ( "//div[@id='new-variant-details']//dl" , document , null , XPathResult . ANY_TYPE , null ) ;
45- var variantBoxHTML = variantBox . iterateNext ( ) . innerHTML ;
4643
47- // for 3 and 4 start vcvs the review status and classification are found with the following
48- var vcvClassificationText = document . evaluate ( "//div[@class='germline-section']//div[@class='classi-text'] " , document , null , XPathResult . ANY_TYPE , null ) ;
49- var vcvReviewStatus = document . evaluate ( "//div[@class='germline-section']//div[@class='review-text']" , document , null , XPathResult . ANY_TYPE , null ) ;
44+ var vcvClassificationText = document . evaluate ( "//div[@class='germline-section']//div[@class='single-item-value']/text()" , document , null , XPathResult . STRING_TYPE , null ) . stringValue . trim ( ) ;
45+ var vcvReviewStatus = document . evaluate ( "//div[@class='germline-section']//div[@id='germline-stars-icon']/p/text() " , document , null , XPathResult . STRING_TYPE , null ) . stringValue . trim ( ) ;
46+ vcvReviewStatus = vcvReviewStatus . replace ( / \. $ / g , '' ) ;
5047
51- var vcvClassificationTextNode = vcvClassificationText . iterateNext ( ) ;
52- var vcvReviewStatusNode = vcvReviewStatus . iterateNext ( ) ;
53-
54- if ( ! vcvClassificationTextNode ) {
55- // for 2 star and below the vcvs review status and classifiction are found with the following
56- vcvClassificationText = document . evaluate ( "//div[@class='germline-section']//div[@class='single-item-value']" , document , null , XPathResult . ANY_TYPE , null ) ;
57- vcvReviewStatus = document . evaluate ( "//div[@class='germline-section']//div[@class='section-cnt']//span" , document , null , XPathResult . ANY_TYPE , null ) ;
58- vcvClassificationTextNode = vcvClassificationText . iterateNext ( ) ;
59- vcvReviewStatusNode = vcvReviewStatus . iterateNext ( ) ;
60- }
61-
62- if ( ! vcvClassificationTextNode ) {
63- // for vcv with no germline scvs there is no classification and review status
64- vcvClassificationText = document . evaluate ( "//div[@class='germline-section']/p[@class='without-classification']" , document , null , XPathResult . ANY_TYPE , null ) ;
65- vcvReviewStatus = document . evaluate ( "//div[@class='germline-section']/p[@class='without-classification']" , document , null , XPathResult . ANY_TYPE , null ) ;
66- vcvClassificationTextNode = vcvClassificationText . iterateNext ( ) ;
67- vcvReviewStatusNode = vcvReviewStatus . iterateNext ( ) ;
68- }
48+ var variantBox = document . evaluate ( "//div[@id='new-variant-details']//dl" , document , null , XPathResult . ANY_TYPE , null ) ;
49+ var variantBoxHTML = variantBox . iterateNext ( ) . innerHTML ;
6950
7051 clinvarData . name = document . querySelectorAll ( '#variant-details-table div div dl dd p' ) [ 0 ] . innerText ;
7152 clinvarData . vcv = getMatch ( variantBoxHTML , vcv_accession_re , 1 ) ;
7253 clinvarData . variation_id = getMatch ( variantBoxHTML , vcv_variation_id_re , 1 ) ;
73- clinvarData . vcv_review = vcvReviewStatusNode . textContent . trim ( ) ;
74- clinvarData . vcv_interp = vcvClassificationTextNode . textContent . trim ( ) ;
54+ clinvarData . vcv_review = vcvReviewStatus ;
55+ clinvarData . vcv_interp = vcvClassificationText ;
7556
7657 var timelineArray = document . querySelectorAll ( 'table.timeline-table tbody tr td' ) ;
7758 clinvarData . vcv_most_recent = timelineArray [ 2 ] . innerHTML ;
0 commit comments